• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • backup-plugin
    • None
    • Any

      I guess it would be very useful to have the possibility to schedule the backup task inside the backup plugin. Probably it is possible to use the hudson scheduler like any other job.

          [JENKINS-5734] Add scheduling to backup plugin

          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.

          jeremydavidson added a comment - 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.

          Romain Seguy added a comment -

          Thanks for the submission. I'm not sure having a builder to automatically trigger backup is the best solution we can have. What about using the AdministrativeMonitor extension to do that?

          Romain Seguy added a comment - Thanks for the submission. I'm not sure having a builder to automatically trigger backup is the best solution we can have. What about using the AdministrativeMonitor extension to do that?

          dp added a comment -

          As part of this issue, would it be possible to flag a failed backup somehow? A red/amber/green ball in the sidebar perhaps?

          With a manual backup you can check immediately that the backup has worked. But with (e.g.) a nightly backup you don't want to check the backup manually every day.

          It would also be handy to be able to keep logs for the backup for a configurable number of days in the past (in case the problem isn't spotted immediately, e.g. on a weekend).

          dp added a comment - As part of this issue, would it be possible to flag a failed backup somehow? A red/amber/green ball in the sidebar perhaps? With a manual backup you can check immediately that the backup has worked. But with (e.g.) a nightly backup you don't want to check the backup manually every day. It would also be handy to be able to keep logs for the backup for a configurable number of days in the past (in case the problem isn't spotted immediately, e.g. on a weekend).

            Unassigned Unassigned
            mambu Marco Ambu
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: