summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-21 10:37:27 +0200
committerValery Sizov <vsv2711@gmail.com>2015-07-21 13:22:40 +0300
commitab94ed089af94c3dced6a4d61c514c3119cee1d4 (patch)
treec045e4d9a1a7942c51fc44d3f1937d66f51bc8e6
parent6f3c99e4d51fea72b4930c12bd517dfe8de9184e (diff)
downloadgitlab-ce-ab94ed089af94c3dced6a4d61c514c3119cee1d4.tar.gz
Don't stop if database.sql.gz already exists
The existing behavior of the backups is to overwrite whatever data was still there in the scratch directories. This broke when we added a 'gzip' step because 'gzip database.sql' will fail if 'database.sql.gz' already exists. Doing 'rm -f database.sql.gz' before the 'gzip' avoids this failure.
-rw-r--r--lib/backup/database.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index b8aa6b9ff2f..c5a5396cbbf 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -25,6 +25,7 @@ module Backup
abort 'Backup failed' unless success
$progress.print 'Compressing database ... '
+ FileUtils.rm_f db_file_name_gz
success = system('gzip', db_file_name)
report_success(success)
abort 'Backup failed: compress error' unless success