diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-30 11:17:34 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-30 11:17:34 +0300 |
commit | baa157926d432f404a41c31ad6514ff8d5366269 (patch) | |
tree | 106b84811dfd7a832fd82300f590dd3763621bc4 /lib/backup/uploads.rb | |
parent | c5aae3077335ab0eaafb73f51548d4c85413a1d1 (diff) |
Stricter mkdir's in 'rake gitlab:backup:create'
Diffstat (limited to 'lib/backup/uploads.rb')
-rw-r--r-- | lib/backup/uploads.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/backup/uploads.rb b/lib/backup/uploads.rb index ed445f79084..1f9626644e6 100644 --- a/lib/backup/uploads.rb +++ b/lib/backup/uploads.rb @@ -10,7 +10,11 @@ module Backup # Copy uploads from public/uploads to backup/uploads def dump - FileUtils.mkdir_p(backup_uploads_dir, mode: 0700) + FileUtils.rm_rf(backup_uploads_dir) + # Ensure the parent dir of backup_uploads_dir exists + FileUtils.mkdir_p(Gitlab.config.backup.path) + # Fail if somebody raced to create backup_uploads_dir before us + FileUtils.mkdir(backup_uploads_dir, mode: 0700) FileUtils.cp_r(app_uploads_dir, backup_dir) end |