I've attached a patch for the 1.5 source which provides a possible solution to this problem. All this does is adds a build step that can be added to jobs, which can then be scheduled. I also slightly rearranged BackupLink.java to this end.
I don't know if this is the best solution, as I haven't thought too much about it, nor do I know if I went about it properly. I just needed this functionality, and no one else appeared to be working on it, so I threw it together.
As far as I can tell, it works. There are a couple areas I can see room for improvement:
1. Wait for the backup to complete before allowing the job to finish. Right now, the build step just starts the backup (like clicking the link on the Manage Hudson page), and if there's nothing else in the job, the build will be marked a success and finished. It's debatable, but I think I'd prefer it to wait.
2. Output the same log from the backup page to the build log. I'm just dumping a couple quick messages, which, in the end, aren't very helpful, but they do get the job done. I think that combined with #1, automatic backups would be plenty intuitive and flexible.
I've attached a patch for the 1.5 source which provides a possible solution to this problem. All this does is adds a build step that can be added to jobs, which can then be scheduled. I also slightly rearranged BackupLink.java to this end.
I don't know if this is the best solution, as I haven't thought too much about it, nor do I know if I went about it properly. I just needed this functionality, and no one else appeared to be working on it, so I threw it together.
As far as I can tell, it works. There are a couple areas I can see room for improvement:
1. Wait for the backup to complete before allowing the job to finish. Right now, the build step just starts the backup (like clicking the link on the Manage Hudson page), and if there's nothing else in the job, the build will be marked a success and finished. It's debatable, but I think I'd prefer it to wait.
2. Output the same log from the backup page to the build log. I'm just dumping a couple quick messages, which, in the end, aren't very helpful, but they do get the job done. I think that combined with #1, automatic backups would be plenty intuitive and flexible.