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-06-07 18:11:49 +0300
committerDouwe Maan <douwe@gitlab.com>2018-06-07 18:11:49 +0300
commita01c815db28c888e2f5246c05f4da349d6dfc4f3 (patch)
treea11de74081344631abcfcba06731b003b2822759
parentcc28c119807a7ac4ccaec74ba3a7d8a9a3f8870f (diff)
parent6dfb0b4b3194519b5000bfba3e736f48d58d5255 (diff)
Merge branch 'backup-rake-tar' into 'master'
Consistently use tar lookup function See merge request gitlab-org/gitlab-ce!19477
-rw-r--r--lib/backup/files.rb11
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