diff options
author | julien MILLAU <mxjulien@gmail.com> | 2017-12-20 11:11:13 +0300 |
---|---|---|
committer | julien MILLAU <mxjulien@gmail.com> | 2017-12-20 11:11:13 +0300 |
commit | a331a06aa8da542afa985d61370b9518cc44b1e9 (patch) | |
tree | 2016857a89be7d887122314a1c542927bb50ac13 /lib | |
parent | dc1692801d37b0859f61be2cdd3d8e5bf9f49962 (diff) |
Ignore "lost+found" folder during backup on a volume
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backup/files.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |