Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comments
Comment #1
ronan CreditAttribution: ronan commentedHmm.. 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)
Comment #2
radman16 CreditAttribution: radman16 commentedGreat, I will look forward to trying out version 2.
Comment #3
2noame CreditAttribution: 2noame commentedI second this. I'd love to be able to set it to backup every day around 0500.
Comment #4
bluerobot CreditAttribution: bluerobot commentedI 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.
Comment #5
bluerobot CreditAttribution: bluerobot commentedThe 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.
Comment #6
stephenhendry CreditAttribution: stephenhendry commentedWhat variable did you change? I only can see:
backup_migrate_destination_id
backup_migrate_profile_id
backup_migrate_source_id
Comment #7
ronan CreditAttribution: ronan commentedI'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.
Comment #8
kswan CreditAttribution: kswan commentedThis 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?
Comment #9
adam_b CreditAttribution: adam_b commentedsubscribing
Some cron mechanism sounds good to me, or could it be invoked by Actions or Rules?
Comment #10
ronan CreditAttribution: ronan commentedBackup 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?
Comment #11
gotheric CreditAttribution: gotheric commentedWith 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:
This way everyone installs backup and migrate and uses elysia cron will have the default execution rule to "every sunday at midnight".
Comment #12
TimeFor CreditAttribution: TimeFor commentedVery 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
Comment #13
Aren Cambre CreditAttribution: Aren Cambre commentedWould also like this to guarantee off-peak backups. Does this go into D7 first and backport?
Comment #14
kswan CreditAttribution: kswan commentedA possibility similar to Option 1 (in #8 above) is to use the backup_migrate drush support. In theory a cron job could be setup that uses drush to run a backup.
Unfortunately, backup_migrate doesn't work with Drush 3.0 (see #720580: Drush 3.0 doesn't allow spaces in commands and #715472: "drush bam destinations" is an empty list). I haven't tested backup_migrate with Drush 2.x.
I would suggest that improving drush support (plus some documentation) will resolve this issue.
Comment #15
j0nathan CreditAttribution: j0nathan commentedsubscribing...
Comment #16
Aren Cambre CreditAttribution: Aren Cambre commentedGoing to be bold and move to D7 since that is customary place for new features.
Comment #17
vitis CreditAttribution: vitis commentedsubscribing
Comment #18
supersteph CreditAttribution: supersteph commentedlooking forward to seeing the results of this thread...
Comment #19
Todd Zebert CreditAttribution: Todd Zebert commentedI'm curious what bluerobot did in #4 & 5 myself, like #6 I found only those backup_migrate vars, and I'm not sure what to do with the info #7 provided. Thanks!
Comment #20
mpaler CreditAttribution: mpaler commentedsubscribe
Comment #21
Magnus CreditAttribution: Magnus commentedSubscribe
Comment #22
jzornig CreditAttribution: jzornig commentedI'm running the current dev version of B&M module but in the Devel variable editor, I see no variables related to backup/migrate/schedule etc. Currently my backup is running at 10am daily which is at peak usage time. I'd like to set it to 3am.
I suppose I could wake up at 3am and create a new daily schedule ;-(
Comment #23
feuillet CreditAttribution: feuillet commentedI am also interested in wich variable #4 exactly has to be editet. can not find one...
Comment #24
superflyman CreditAttribution: superflyman commentedsubscribing
Comment #25
premanup CreditAttribution: premanup commentedsubscribing
Comment #26
DoubleT CreditAttribution: DoubleT commentedSubscribing
Comment #27
thekenshow CreditAttribution: thekenshow commentedFor those looking to change the D6 schedule time by editing the variable, backup_migrate 6.x-2.2 doesn't store the last run in a variable, it's in the last_run field in the backup_migrate_schedules table in the database. The unix time stamp bit still applies, of course.
Comment #28
jakonore CreditAttribution: jakonore commentedsubscribe
Comment #29
AlfTheCat CreditAttribution: AlfTheCat commentedsubscribing (hope to see some of this for D6 still.....)
Comment #30
inversed CreditAttribution: inversed commentedsubscribe
Comment #31
farshid CreditAttribution: farshid commented(D6) What I did for this was to add a module and define hook_cron:
Comment #32
AlfTheCat CreditAttribution: AlfTheCat commentedthx farshid!
Comment #33
spgd01 CreditAttribution: spgd01 commentedsubscribe for 6.x and 7.x
Comment #34
Andreyy CreditAttribution: Andreyy commentedCan anybody explain how to use the code of farshid?
Comment #35
farshid CreditAttribution: farshid commentedAndreyy, create a folder named: backupmigrate_schedules_time_fix
add 2 files in it:
1 - backupmigrate_schedules_time_fix.info, here is what you need in it:
go to http://drupal.org/node/231036 for information on .info files
2 - backupmigrate_schedules_time_fix.module -> the code in #31 goes here
put the folder in sites/all/modules and install it in drupal admin section as any other modules.
You are good to go, I have not tested this, as I have added this to another module of mine, so post if any problems.
Comment #36
Andreyy CreditAttribution: Andreyy commentedHi farshid
Unfortunatelly the manual run of cron generate error (cron running overtimed) and white screen.
Comment #37
farshid CreditAttribution: farshid commentedAndreyy
try increasing PHP max execution time in php.ini if the problem resists, first you need to find out the module causing problems... I have found some related code somewhere, I do not remember, though here it is:
go to includes/module.inc and find: function module_invoke_all(), add some code to watch for cron hook calls:
run cron and after the WSOD appears go to dblog to find out on which module cron you are having problems... disable the module and test again. wish this helps... though this topic is not the place to talk about it. sorry guys.
Comment #38
Andreyy CreditAttribution: Andreyy commentedHi farshid,
I get the white screen when I switch on module backupmigrate_schedules_time_fix.
Comment #39
TimeFor CreditAttribution: TimeFor commentedWhere can I edit the last run time in D7 version?
- Jayson
Comment #40
ronan CreditAttribution: ronan commentedElysia cron support is now in the 3.x branch.
Comment #41
Andreyy CreditAttribution: Andreyy commentedIn the table "variables"
Comment #42
ronan CreditAttribution: ronan commented