Is there (an automated) way to backup Hudson CI files?

后端 未结 6 2055
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 05:37

Here at my company we have three Hudson CI servers with 100+ jobs configured. We are looking for an automated way to periodically backup job configurations and

6条回答
  •  野的像风
    2021-02-06 05:56

    My Hudson servers run on windows, so I use Robocopy for this. I have it mirror all files in each build server's hudson home, excluding job workspace directories. Since the backups are going to a central place, I have a scheduled task on a fileserver that runs my script nightly, and the Hudson servers are unaware of the process.

    The script has one entry per hudson machine:

    robocopy path-to-buildserver-hudson-home backup-folder-path\buildserver-name /ZB /E /NP /R:1 /W:5 "/LOG:%~dp0backup_log.txt" /TEE /XD workspace

    Note: after the first machine, it becomes /LOG+: instead of /LOG: so that the next ones append to the log.

    This mirrors without deleting files that don't exist in source, so even if Hudson is setup to delete build results after X months or Y builds, the backups could still have the full history...as well as logs to console and a file, and is resumable if it gets interrupted. It's handy. If you didn't want it to retain files Hudson has deleted, you could use /MIR instead of /E.

    I'm sure similar tools for robust copies or mirroring exist on other platforms. Ant is probably sufficient if done right.

提交回复
热议问题