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
Jérome Perrin
gitlab-ce
Commits
36f3de4f
Commit
36f3de4f
authored
Nov 05, 2013
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplication in Backup::Manager
parent
a540ab42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/backup/manager.rb
lib/backup/manager.rb
+4
-2
No files found.
lib/backup/manager.rb
View file @
36f3de4f
module
Backup
class
Manager
BACKUP_CONTENTS
=
%w{repositories/ db/ uploads/ backup_information.yml}
def
pack
# saving additional informations
s
=
{}
...
...
@@ -16,7 +18,7 @@ module Backup
# create archive
print
"Creating backup archive:
#{
s
[
:backup_created_at
].
to_i
}
_gitlab_backup.tar ... "
if
Kernel
.
system
(
*
%W(tar -cf
#{
s
[
:backup_created_at
].
to_i
}
_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml)
)
if
Kernel
.
system
(
'tar'
,
'-cf'
,
"
#{
s
[
:backup_created_at
].
to_i
}
_gitlab_backup.tar"
,
*
BACKUP_CONTENTS
)
puts
"done"
.
green
else
puts
"failed"
.
red
...
...
@@ -25,7 +27,7 @@ module Backup
def
cleanup
print
"Deleting tmp directories ... "
if
Kernel
.
system
(
*
%W(rm -rf repositories/ db/ uploads/ backup_information.yml)
)
if
Kernel
.
system
(
'rm'
,
'-rf'
,
*
BACKUP_CONTENTS
)
puts
"done"
.
green
else
puts
"failed"
.
red
...
...
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