Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-21 11:37:27 +0300
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-21 11:37:27 +0300
commit346b07497989c824b201e501dfa24b8af630da8a (patch)
tree048bdf9096924d2e741a70741bf07d7cafc6584b /lib/backup
parent57f9a1ccd4e97747cf09ffd98e8c44056c0846e5 (diff)
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.
Diffstat (limited to 'lib/backup')
-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