summaryrefslogtreecommitdiff
path: root/lib/backup/helper.rb
diff options
context:
space:
mode:
authorBalasankar "Balu" C <balasankar@gitlab.com>2018-03-05 13:55:02 +0530
committerBalasankar "Balu" C <balasankar@gitlab.com>2018-03-27 12:55:57 +0530
commitbaa68c827b1e5fd9df717a1b801459ee21df77ef (patch)
tree64956d62b22a9815001878eb647139aa6acd7191 /lib/backup/helper.rb
parent0efbcc6c12f821606763569e2ac6c5038269436f (diff)
downloadgitlab-ce-42593-restore-rake-task.tar.gz
Move existing dirs to a temp location while restore42593-restore-rake-task
Instead of renaming existing storage directories to a timestamped format, create a timestamped directory in a temporary location and move the individual files and folders inside storage directories to it. This helps us with nested storage directories.
Diffstat (limited to 'lib/backup/helper.rb')
-rw-r--r--lib/backup/helper.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/backup/helper.rb b/lib/backup/helper.rb
new file mode 100644
index 00000000000..a1ee0faefe9
--- /dev/null
+++ b/lib/backup/helper.rb
@@ -0,0 +1,17 @@
+module Backup
+ module Helper
+ def access_denied_error(path)
+ message = <<~EOS
+
+ ### NOTICE ###
+ As part of restore, the task tried to move existing content from #{path}.
+ However, it seems that directory contains files/folders that are not owned
+ by the user #{Gitlab.config.gitlab.user}. To proceed, please move the files
+ or folders inside #{path} to a secure location so that #{path} is empty and
+ run restore task again.
+
+ EOS
+ raise message
+ end
+ end
+end