Commit 83a232d3 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

custom backup tarball works again, fixed some filename funnies

parent f77b1576
......@@ -370,7 +370,7 @@ function _provision_backup($url) {
$suggested = "$backup_path/$url-" . date("Y-m-d", mktime()) . "_$count.tar";
}
$data['backup_file'] = (!empty($file)) ? $file : $suggested;
$data['backup_file'] = (!empty($file)) ? ereg_replace('.gz$', '', $file) : $suggested;
$rolled_back = provision_invoke("backup", $url, $data);
provision_shell_exec("gzip %s", $data['backup_file']);
$data['backup_file'] = $data['backup_file'] . '.gz';
......
......@@ -103,6 +103,6 @@ function provision_mysql_provision_pre_install($url, &$data) {
function provision_mysql_provision_backup($url, &$data) {
provision_log("backup", "Generating mysql dump for $url.");
provision_shell_exec("mysqldump -u%s -p%s %s > sites/%s/database.sql", $data['site-db-username'], $data['site-db-passwd'], $data['site-db-name'], $url);
provision_shell_exec("cd sites/%; tar -rf %s database.sql", $url, $data['backup_file']);
provision_shell_exec("rm sites/%s/database.sql", $url);
provision_shell_exec("cd sites/%; tar -rf %s database.sql; rm database.sql", $url, $data['backup_file']);
}
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