diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-21 11:37:27 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-21 11:37:27 +0300 |
commit | 346b07497989c824b201e501dfa24b8af630da8a (patch) | |
tree | 048bdf9096924d2e741a70741bf07d7cafc6584b /lib/backup/database.rb | |
parent | 57f9a1ccd4e97747cf09ffd98e8c44056c0846e5 (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/database.rb')
-rw-r--r-- | lib/backup/database.rb | 1 |
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 |