Problem/Motivation
The `bam-backup` command allow running a backup from a selected source to a selected destination. However, there is no way to pre-configure a backup and run it with cron. According to the configuration UI for a schedule this should be available.
Proposed resolution
Add Drush commands to list exsiting schedule and run them.
Original report
On the Edit Schedule form, it is implied that a particular schedule can be run from drush:
- Do not run automatically
- Do not run this schedule automatically. You can still run it using Drush.
There are only 3 arguments for bam-backup: source, destination, and profile. There is nowhere to select the schedule.
I have run drush bam-backup while setting the destination and profile to those set in my configured Schedule, but despite this, the schedule's "Last Run" is always set as "Never".
Is there a way to run a specific Schedule from drush?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | backup_migrate-n2494757-9.patch | 2.22 KB | damienmckenna |
| #4 | backup_migrate-drush-schedule-2494757-4.patch | 2.24 KB | pbuyle |
Comments
Comment #1
Ives commentedDoesn't seem possible atm, no reference to schedules in the source.
Comment #2
Ives commentedHere's a quick patch (for 7.x-3.1) that adds bam-schedule and bam-schedules.
Comment #3
clairedesbois@gmail.comI repost the patch, I only change the path to apply the patch directly in the module's root because my structure isn't the same in sites directory.
Comment #4
pbuyle commentedWe have been using the patch for some times without issue. However, as-is the patch will happily let the user run a disabled schedule using Drush. The attached update fixes this and prevent executing a disabled schedule. IMHO, this match better the wording used when configuring the schedule.
Comment #5
pbuyle commentedComment #6
pbuyle commentedComment #7
couturier commentedThis may need to be re-written based on the release of 7.x-3.2. Also, you may want to consider contributing this functionality to the 8.x branch where all current development is taking place.
Comment #8
damienmckennaComment #9
damienmckennaThanks for putting this together, I'm definitely excited about being able to do this.
This contains minor whitespace and wording changes.
Comment #11
damienmckennaComment #13
damienmckennaCommitted. Thanks everyone!