Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-01-02 18:07:33 +0300
committerDouwe Maan <douwe@gitlab.com>2018-01-02 18:07:33 +0300
commit377024ecbc85c985e56596ab33bac1b23bf14b72 (patch)
tree2f77fddf6f6b2780f3175770232894f3423978a9
parentb6d3dfe5b935872fc8715475e56a528de0589d51 (diff)
parent091c4989b3c1e18723aef2b28475866b1a89e282 (diff)
Merge branch 'fix-volume-backup' into 'master'
Ignore "lost+found" folder during backup on a volume Closes #22672 and #17574 See merge request gitlab-org/gitlab-ce!16036
-rw-r--r--changelogs/unreleased/16036-ignore-lost-found-folder-during-backup-on-a-volume.yml5
-rw-r--r--lib/backup/files.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/changelogs/unreleased/16036-ignore-lost-found-folder-during-backup-on-a-volume.yml b/changelogs/unreleased/16036-ignore-lost-found-folder-during-backup-on-a-volume.yml
new file mode 100644
index 00000000000..833650559a3
--- /dev/null
+++ b/changelogs/unreleased/16036-ignore-lost-found-folder-during-backup-on-a-volume.yml
@@ -0,0 +1,5 @@
+---
+title: "Ignore lost+found folder during backup on a volume"
+merge_request: 16036
+author: Julien Millau
+type: fixed \ No newline at end of file
diff --git a/lib/backup/files.rb b/lib/backup/files.rb
index 30a91647b77..287d591e88d 100644
--- a/lib/backup/files.rb
+++ b/lib/backup/files.rb
@@ -18,7 +18,7 @@ module Backup
FileUtils.rm_f(backup_tarball)
if ENV['STRATEGY'] == 'copy'
- cmd = %W(cp -a #{app_files_dir} #{Gitlab.config.backup.path})
+ cmd = %W(rsync -a --exclude=lost+found #{app_files_dir} #{Gitlab.config.backup.path})
output, status = Gitlab::Popen.popen(cmd)
unless status.zero?
@@ -26,10 +26,10 @@ module Backup
abort 'Backup failed'
end
- run_pipeline!([%W(tar -C #{@backup_files_dir} -cf - .), %w(gzip -c -1)], out: [backup_tarball, 'w', 0600])
+ run_pipeline!([%W(tar --exclude=lost+found -C #{@backup_files_dir} -cf - .), %w(gzip -c -1)], out: [backup_tarball, 'w', 0600])
FileUtils.rm_rf(@backup_files_dir)
else
- run_pipeline!([%W(tar -C #{app_files_dir} -cf - .), %w(gzip -c -1)], out: [backup_tarball, 'w', 0600])
+ run_pipeline!([%W(tar --exclude=lost+found -C #{app_files_dir} -cf - .), %w(gzip -c -1)], out: [backup_tarball, 'w', 0600])
end
end