views:

1199

answers:

4

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 build history.

Currently we have an ant script that we configure as a job but it's not easy to maintain and not elegant.

Have any of you found a way to manage this?

+3  A: 

There is a Backup Plugin.

I don't believe that it supports scheduling of periodic backups, but you might be able to trigger it by accessing it through the URL (like some other Hudson remote APIs), in which case you might be able to simply set up a cron job to ping the URL.

matt b
Yes, it would be an option but our hudson servers require login. Anyway, Backup Plugin seems to be the best option, maybe it's just a matter of contributing a scheduling patch to the project.
Kalecser
+1  A: 

I would manage it with a standard enterprise server backup solution.

Or roll my own with something like BackupPc.

Or check the config files into your version control system.

Sean Cavanagh
+1  A: 

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.

Joshua McKinnon
A: 

The plugin doesn't seem to work for me at all. (windows7)

When I attempt to run it, it appears to hang when trying to shutdown hudson.

There is no output in the log file, nor are there backups.

Tim
Why do you post this as an answer instead of a comment?
Pascal Thivent
Because it answered the question.
Tim
Oh, then I don't read the same question as you :)
Pascal Thivent
If I asked a question about a backup plugin I would like to get information on whether it works or if people have problems with it.
Tim