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?

Comments

Ives’s picture

Doesn't seem possible atm, no reference to schedules in the source.

Ives’s picture

Here's a quick patch (for 7.x-3.1) that adds bam-schedule and bam-schedules.

clairedesbois@gmail.com’s picture

I 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.

pbuyle’s picture

StatusFileSize
new2.24 KB

We 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.

pbuyle’s picture

Status: Active » Needs review
pbuyle’s picture

Title: How to select a particular schedule when running bam-backup via drush? » Allow running a scheduled backup with Drush
Category: Support request » Feature request
Issue summary: View changes
couturier’s picture

Status: Needs review » Needs work

This 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.

damienmckenna’s picture

Status: Needs work » Needs review
damienmckenna’s picture

Thanks for putting this together, I'm definitely excited about being able to do this.

This contains minor whitespace and wording changes.

Status: Needs review » Needs work

The last submitted patch, 9: backup_migrate-n2494757-9.patch, failed testing. View results

damienmckenna’s picture

Status: Needs work » Needs review

  • DamienMcKenna committed d863694 on 7.x-3.x authored by Ives
    Issue #2494757 by pbuyle, DamienMcKenna, Ives, Calystod: Allow running a...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.