Commit a01c815d authored by Douwe Maan's avatar Douwe Maan

Merge branch 'backup-rake-tar' into 'master'

Consistently use tar lookup function

See merge request gitlab-org/gitlab-ce!19477
parents cc28c119 6dfb0b4b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment