Commit e52c96f0 authored by anarcat's avatar anarcat Committed by anarcat

#678636 - ability to delete backups from the frontend

parent eb92e52f
<?php
/**
* @file
* Provision hooks for the provision backup_delete command.
*/
/**
* Provision backup_delete command
*
* These are the hooks that will be executed by the drush_invoke function
* when deleting a backup file from the backend.
*/
function drush_provision_drupal_provision_backup_delete($backup = null) {
if($backup) {
$backups = explode(',', $backup);
foreach ($backups as $filename) {
$success = provision_file()->unlink($filename)
->succeed('Removed backup file @path')
->fail('Could not remove backup file @path');
}
}
else {
drush_set_error(dt('No backup files provided'));
}
}
......@@ -170,6 +170,11 @@ function provision_drush_command() {
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision-backup_delete'] = array(
'description' => 'Delete a backup file.',
'arguments' => array('backup-file' => dt('The backup file to delete. This will be a gzipped tarball.')),
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH
);
$items['hostmaster-migrate'] = array(
'description' => dt('Migrate an instance of the Hostmaster front end to a new platform'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment