summaryrefslogtreecommitdiff
path: root/lib/backup
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-01 12:55:13 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-01 12:55:13 +0000
commit54e40241f6a61d0fae658501497bb5fb4e342989 (patch)
tree5b2b60474f1e091ab7498cbc895b8b4e10a27989 /lib/backup
parentb97536a578a5e5be1fba329ff3e9755a190d6193 (diff)
parenta47a6f2afd7021600964b6580e863b888532031c (diff)
downloadgitlab-ce-54e40241f6a61d0fae658501497bb5fb4e342989.tar.gz
Merge branch 'backup_uploads_symlink' into 'master'
Backup Uploads Symlink
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/uploads.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/backup/uploads.rb b/lib/backup/uploads.rb
index e79da7e8fd2..e50e1ff4f13 100644
--- a/lib/backup/uploads.rb
+++ b/lib/backup/uploads.rb
@@ -3,7 +3,7 @@ module Backup
attr_reader :app_uploads_dir, :backup_uploads_dir, :backup_dir
def initialize
- @app_uploads_dir = Rails.root.join('public', 'uploads')
+ @app_uploads_dir = File.realpath(Rails.root.join('public', 'uploads'))
@backup_dir = Gitlab.config.backup.path
@backup_uploads_dir = File.join(Gitlab.config.backup.path, 'uploads')
end
@@ -21,8 +21,9 @@ module Backup
end
def backup_existing_uploads_dir
+ timestamped_uploads_path = File.join(app_uploads_dir, '..', "uploads.#{Time.now.to_i}")
if File.exists?(app_uploads_dir)
- FileUtils.mv(app_uploads_dir, Rails.root.join('public', "uploads.#{Time.now.to_i}"))
+ FileUtils.mv(app_uploads_dir, timestamped_uploads_path)
end
end
end