Hello!

My task is to set a rule to auto backup the database when the site moderator logs out. I have set a new rule with all required events and conditions to apply custom PHP code.

Please help me to write that php code.

Default quick backup setting are set.

"default database to manual backups directory using default settings"

Thanks for any help or idea!

Comments

mitchell’s picture

Title: Use backup and Migrate "quick backup", when a specific role logs out » Rules integration: action to execute backup operation
Project: Rules » Backup and Migrate
Component: Rules Engine » Code
Assigned: abeld2 » Unassigned
Category: task » feature
Anonymous’s picture

I'm very keen on this feature, too.

My usecase is a high-traffic community website. To get safe backup copies (i.e. 100% consistent), the site has IMHO to be put into maintenance mode with tables locked. Doing this daily at a random time is a pain. So I decided to let "weak" backups (without locking) happen daily, but I would like to let "strong" backups (with locking and maintenance mode on) take place once a week at a well defined time. Rules is capable of scheduling in this way.

So, with respect to the OP, a Rules action for starting backup tasks would be a quite versatile tool. We should discuss this intensely. I would assist in development and help testing patches for this feature.

mitchell’s picture

Issue tags: +rules integration

It looks like the actions integration wasn't ported from D6. BAM's drush integration, bam-backup and bam-restore, would be a very straightforward port to Rules actions, allowing for its schedules and reactions to be used. #313134: Allow setting scheduled time similar to cron job would be fixed too then. I think you would only additionally need to log the messages to dblog rather than showing them.

netlooker’s picture

While working on the project, I also needed such functionality. Results of my work I posted on github - https://github.com/3drupal/rules_bm. Maybe this will help in the further integration with Rules.

delacosta456’s picture

Issue summary: View changes

hi netlooker

i downloaded your modules but it did not create the back up while i am receiving notification message off backup correctly created

couturier’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

Updating the version as the 7.x-2.x branch will be deprecated soon.

brankoc’s picture

Status: Active » Closed (duplicate)
Related issues: +#842352: Rules support for Backup & Migrate (D7)