How to schedule a backup of Drupal site (especially database) at specific hour on a shared host? I am using Backup Migrate module, but it doesn't support hours, only frequency. It currently makes daily backups around 8 pm.

I checked this shell script, which could be added to cron I think, but it doesn't send mail after backup and doesn't allow to specify "only structure" for cache tables.


Try Elysia Cron, in addition to Backup and Migrate, you can set the time of day to run as well as many other things.

Don't forget to read the documentation.

It is also worth noting that in the default configuration of Drupal 7 cron is triggered by users hitting your site. If the site is not used exactly at the time indicated in Elysia Cron it will be run as soon as someone loads something on your site. Therefore, it is impossible to get this to execute exactly when you want, but it should be close.


You could try a simple shell script that uses mysqldump to dump your Drupal site's database, tar and gzip, and then use mailx or mutt to send an e-mail with the gzipped tarball attached to the e-mail. Then set a cron job that runs that script at the specific time you wish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.