summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-21 10:37:27 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-21 10:37:27 +0200
commit346b07497989c824b201e501dfa24b8af630da8a (patch)
tree048bdf9096924d2e741a70741bf07d7cafc6584b
parent57f9a1ccd4e97747cf09ffd98e8c44056c0846e5 (diff)
downloadgitlab-ce-overwrite-during-backup.tar.gz
Don't stop if database.sql.gz already existsoverwrite-during-backup
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