Commit fc9832b1 authored by Bryan Stearns's avatar Bryan Stearns

Avoid "cannot copy directory to itself" restore error

parent 833bc305
......@@ -23,7 +23,7 @@ module Backup
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, timestamped_uploads_path)
FileUtils.mv(app_uploads_dir, File.expand_path(timestamped_uploads_path))
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment