summaryrefslogtreecommitdiff
path: root/lib/backup/database.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-10-06 15:21:15 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-10-06 15:21:15 +0200
commite789644783fae55f1095ffcc38b32f810f549caa (patch)
tree28d7ae20a76cf2a6228dd959d07023c5dac0d0d1 /lib/backup/database.rb
parent7b71727c562b6f6337a180ae136be94bf0f6ed31 (diff)
downloadgitlab-ce-e789644783fae55f1095ffcc38b32f810f549caa.tar.gz
Keep old path: db/database.sql.gz
Documentation elsewhere refers to this internal path, let's keep it.
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r--lib/backup/database.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index 4bdf6e1c628..fe0434361e8 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -6,10 +6,11 @@ module Backup
def initialize
@config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
- @db_file_name = File.join(Gitlab.config.backup.path, 'database.sql.gz')
+ @db_file_name = File.join(Gitlab.config.backup.path, 'db', 'database.sql.gz')
end
def dump
+ FileUtils.mkdir_p(File.dirname(db_file_name))
FileUtils.rm_f(db_file_name)
compress_rd, compress_wr = IO.pipe
compress_pid = spawn(*%W(gzip -1 -c), in: compress_rd, out: [db_file_name, 'w', 0600])