diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-06-07 20:27:30 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-06-07 20:27:30 +0200 |
commit | b780efab26b83124bd42abf276d0fc388ae68309 (patch) | |
tree | fdd5e88008aa897e68df61cffedf61a617a7aeee /lib/backup/files.rb | |
parent | 2bc1835597446a1240cfb364d1943feb4080e675 (diff) | |
parent | ba4dc01ea83c261c4054c32482b021a1005a1968 (diff) | |
download | gitlab-ce-b780efab26b83124bd42abf276d0fc388ae68309.tar.gz |
Merge remote-tracking branch 'origin/master' into 38542-application-control-panel-in-settings-page
Diffstat (limited to 'lib/backup/files.rb')
-rw-r--r-- | lib/backup/files.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/backup/files.rb b/lib/backup/files.rb index d769a3ee7b0..e287aa1e392 100644 --- a/lib/backup/files.rb +++ b/lib/backup/files.rb @@ -29,10 +29,10 @@ module Backup raise Backup::Error, 'Backup failed' end - run_pipeline!([%W(tar --exclude=lost+found -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 --exclude=lost+found -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 @@ -43,7 +43,12 @@ module Backup end def tar - system(*%w[gtar --version], out: '/dev/null') ? 'gtar' : 'tar' + if system(*%w[gtar --version], out: '/dev/null') + # It looks like we can get GNU tar by running 'gtar' + 'gtar' + else + 'tar' + end end def backup_existing_files_dir |