Commit 7a0cb96a authored by anarcat's avatar anarcat Committed by anarcat

catch errors in switching to the target directory for backups

this happens when we would delete an already existing site, and would
yield to a situation where all of /var/aegir would be backed up
parent 629ce2c1
......@@ -63,7 +63,9 @@ function drush_provision_drupal_provision_backup() {
$olddir = getcwd();
// we need to do this because some retarded implementations of tar (e.g. SunOS) don't support -C
chdir(d()->site_path);
if (!chdir(d()->site_path)) {
return drush_set_error('PROVISION_BACKUP_PATH_NOT_FOUND', dt('cannot change directory to %dir', array('%dir' => d()->site_path)));
}
if (substr($backup_file, -2) == 'gz') {
// same as above: some do not support -z
$command = "tar cpf - . | gzip -c > %s";
......
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