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

#559454 - backup using gzip only when relevant

parent 7b8f72d6
......@@ -49,7 +49,12 @@ function drush_provision_drupal_provision_backup($url) {
$backup_file = drush_get_option('backup_file');
// Adds the site directory into the backup file
drush_log(dt("Adding sites directory to !backup_file", array('!backup_file' => $backup_file)), 'backup');
$result = provision_shell_exec("tar -C %s -p -c -z -f %s .", drush_get_option('sites_path') . "/$url", $backup_file);
if (substr($backup_file, -2) == 'gz') {
$command = "tar -C %s -p -c -z -f %s .";
} else {
$command = "tar -C %s -p -c -f %s .";
}
$result = provision_shell_exec($command, drush_get_option('sites_path') . "/$url", $backup_file);
if (!$result && !drush_get_option('force', false)) {
drush_set_error('PROVISION_BACKUP_FAILED', dt("Could not back up sites directory for drupal"));
......
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