Skip to content
Snippets Groups Projects
Commit 36f3de4f authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Remove duplication in Backup::Manager

parent a540ab42
No related branches found
No related tags found
No related merge requests found
module Backup
class Manager
BACKUP_CONTENTS = %w{repositories/ db/ uploads/ backup_information.yml}
def pack
# saving additional informations
s = {}
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment