Allow setting scheduled time similar to cron job
radman16 - September 25, 2008 - 02:54
| Project: | Backup and Migrate |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Instead of just being able to set backups to run every X number of hours how about doing something similar to cron jobs where you can set it to run every X hours or at a specific time daily or certain days of the week etc.
btw this is a great module

#1
Hmm.. not a bad idea, I can see the value in having the module run in off-peak hours. I'll put it on the todo for version 2 (version 1 is feature stable)
#2
Great, I will look forward to trying out version 2.
#3
I second this. I'd love to be able to set it to backup every day around 0500.
#4
I just used the devel module's variable editor and the online tool at http://www.unixtimestamp.com to change my settings. I'll try to remember to come back and report success or failure.
#5
The technique I tried in post #4 did work - took a couple of rounds to get it to stick. However, the backup time is creeping up an hour a day.
#6
What variable did you change? I only can see:
backup_migrate_destination_id
backup_migrate_profile_id
backup_migrate_source_id
#7
I'm not sure what excactly @bluerobot did, but he probably edited the last run time of the schedule to make the module think it had run at 5am so that it would run again 24 hours later.
To stop the time creep, try setting the period to slightly below 24 hours. 1430 minutes for example. That way the period will definitely have expired by the time cron runs and execution gets to backup and migrate.
#8
This would definitely be a useful feature. I am considering preparing a patch, but there are a few different directions I am considering.
Options 1 and 2 are nice because they allow very flexible scheduling by leveraging existing scheduling code, but they are more complicated to administer.
Any thoughts on these options or some options I missed?
#9
subscribing
Some cron mechanism sounds good to me, or could it be invoked by Actions or Rules?
#10
Backup and migrate can be run using actions, but only using the default settings. The module doesn't work with Rules, but it used to work with workflow_ng, so I should be able to add back Rules support fairly easily.
I'm not aware of any way to get cron-like scheduling with either Actions or Rules but if such a thing does exist then I can add better support for those modules to allow this feature to work.
Anybody know if this kind of scheduling is possible?
#11
With elysia_cron http://drupal.org/project/elysia_cron everyone can associate a cron rule to backup_migrate_cron such as "0 0 * * 0" to run backup job every sunday at midnight.
A module developer can add a default rule to his module by adding some lines of php:
function backup_migrate_cronapi($op, $job = NULL) {switch ($op) {
case 'list':
return array(
' backup_migrate_cron' => 'Backup and migrate',
);
case 'rule':
return '0 0 * * 0';
}
}
This way everyone installs backup and migrate and uses elysia cron will have the default execution rule to "every sunday at midnight".
#12
Very interested as well. I like being able to take my site offline when the backup takes place but I don't want this to happen during business hours. I think option 1 here is the best so we don't have to reply on another module for something that seems simple. I don't think a specific time is as important as long as its just off peak. Settings cron jobs is pretty easy so I don't think this would be too much of a burden on administrators.
- Jayson