Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6dfb0b4b
Commit
6dfb0b4b
authored
Jun 06, 2018
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use tar lookup function
parent
66c02b3f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
lib/backup/files.rb
lib/backup/files.rb
+8
-3
No files found.
lib/backup/files.rb
View file @
6dfb0b4b
...
@@ -29,10 +29,10 @@ module Backup
...
@@ -29,10 +29,10 @@ module Backup
raise
Backup
::
Error
,
'Backup failed'
raise
Backup
::
Error
,
'Backup failed'
end
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
)
FileUtils
.
rm_rf
(
@backup_files_dir
)
else
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
end
end
...
@@ -43,7 +43,12 @@ module Backup
...
@@ -43,7 +43,12 @@ module Backup
end
end
def
tar
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
end
def
backup_existing_files_dir
def
backup_existing_files_dir
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment