diff --git a/README.txt b/README.txt index f642ba2..a5c7b41 100644 --- a/README.txt +++ b/README.txt @@ -22,6 +22,11 @@ Configuration 1. Settings are available at 'admin/hosting/backup_manager' and allow you to e.g. choose the numbers of backups to keep after specified periods of time. +2. To change the directory where exported backups are placed you have to change two variables. +For the frontent there is the Drupal variable 'aegir_backup_export_path' which can be added +to the hostmaster's local.settings.php or set via 'drush @hostmaster variable-set' +The second is in Drush land, called 'provision_backup_export_path' which can se set in a drushrc.php file. +Like: `$options['provision_backup_export_path'] = '/var/aegir/backup-exports';` TODO ---- diff --git a/drush/hosting_site_backup_manager.drush.inc b/drush/hosting_site_backup_manager.drush.inc index 5049fd3..e061106 100644 --- a/drush/hosting_site_backup_manager.drush.inc +++ b/drush/hosting_site_backup_manager.drush.inc @@ -56,7 +56,8 @@ function drush_hosting_site_backup_manager_provision_export_backup($backup) { drush_log(dt('Start export backup command'), 'ok'); // Path for exported backups. - $backupdir = drush_get_option('aegir_backup_export_path', '/var/aegir/backup-exports'); + $default_backup_exports = d('@server_master')->aegir_root . "/backup-exports"; + $backupdir = drush_get_option('provision_backup_export_path', $default_backup_exports); if (!is_dir($backupdir)) { provision_file()->create_dir($backupdir, dt('General backup export directory'), 0751); } @@ -82,10 +83,9 @@ function drush_hosting_site_backup_manager_provision_export_backup($backup) { function drush_hosting_site_backup_manager_provision_remove_export_backup($export) { drush_log(dt('Start remove export backup command'), 'ok'); - include_once dirname(__FILE__) . '/../hosting_site_backup_manager.inc'; - // Path for exported backups. - $backupdir = drush_get_option('aegir_backup_export_path', '/var/aegir/backup-exports'); + $default_backup_exports = d('@server_master')->aegir_root . "/backup-exports"; + $backupdir = drush_get_option('provision_backup_export_path', $default_backup_exports); if (drush_shell_cd_and_exec($backupdir, 'rm %s', $export)) { drush_log(dt('Backup export removed', array()), 'ok');