diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /lib/backup | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/files.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/backup/files.rb b/lib/backup/files.rb index a0948f8c0f5..0f6ed847dea 100644 --- a/lib/backup/files.rb +++ b/lib/backup/files.rb @@ -26,9 +26,15 @@ module Backup FileUtils.rm_f(backup_tarball) if ENV['STRATEGY'] == 'copy' - cmd = [%w[rsync -a], exclude_dirs(:rsync), %W[#{app_files_dir} #{Gitlab.config.backup.path}]].flatten + cmd = [%w[rsync -a --delete], exclude_dirs(:rsync), %W[#{app_files_dir} #{Gitlab.config.backup.path}]].flatten output, status = Gitlab::Popen.popen(cmd) + # Retry if rsync source files vanish + if status == 24 + $stdout.puts "Warning: files vanished during rsync, retrying..." + output, status = Gitlab::Popen.popen(cmd) + end + unless status == 0 puts output raise Backup::Error, 'Backup failed' |