diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-01 12:55:13 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-01 12:55:13 +0000 |
commit | 54e40241f6a61d0fae658501497bb5fb4e342989 (patch) | |
tree | 5b2b60474f1e091ab7498cbc895b8b4e10a27989 /lib/backup | |
parent | b97536a578a5e5be1fba329ff3e9755a190d6193 (diff) | |
parent | a47a6f2afd7021600964b6580e863b888532031c (diff) | |
download | gitlab-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.rb | 5 |
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 |