diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-11-05 16:25:37 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-11-06 14:02:28 +0100 |
commit | 36f3de4f59313c2f3582dd65f802b9ebf92e6bb9 (patch) | |
tree | a92ccc0c6e1e65bf38f89e963d9d750bd461bd36 /lib/backup/manager.rb | |
parent | a540ab429025695659bcfad50ae9943cca6c60a9 (diff) | |
download | gitlab-ce-36f3de4f59313c2f3582dd65f802b9ebf92e6bb9.tar.gz |
Remove duplication in Backup::Manager
Diffstat (limited to 'lib/backup/manager.rb')
-rw-r--r-- | lib/backup/manager.rb | 6 |
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 |