I am developing a module which performs some DB queries on a cron run. I would like to perform a backup of the DB in that cron hook. I have both Drush and Backup and Migrate installed. Has anyone done this?

Comments

DB Dump on cron run.

Hi,

You have achieve this functionality number of ways.
First few are listed below.

1) Implement the DB dump as "drupal action" in your custom module, this action will be available for rule(Contributed module). Create rule which call this action on evey cron run(Also check with the trigger).

2) Implement the hook_cron which either call "drush sql-dump"(read about "drush sql command") with system ("drush sql-dump"). Dump as sql query formate.

3) Check with Back and migrate module does provide schedule DB dump on cron run.

Hope, it could work for you.

Tushar Bodake