summaryrefslogtreecommitdiff
path: root/lib/backup/manager.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2013-11-05 16:25:37 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2013-11-06 14:02:28 +0100
commit36f3de4f59313c2f3582dd65f802b9ebf92e6bb9 (patch)
treea92ccc0c6e1e65bf38f89e963d9d750bd461bd36 /lib/backup/manager.rb
parenta540ab429025695659bcfad50ae9943cca6c60a9 (diff)
downloadgitlab-ce-36f3de4f59313c2f3582dd65f802b9ebf92e6bb9.tar.gz
Remove duplication in Backup::Manager
Diffstat (limited to 'lib/backup/manager.rb')
-rw-r--r--lib/backup/manager.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb
index 3b2f525c0e4..efaefa4ce44 100644
--- a/lib/backup/manager.rb
+++ b/lib/backup/manager.rb
@@ -1,5 +1,7 @@
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