summaryrefslogtreecommitdiff
path: root/lib/backup/database.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-11-20 15:46:04 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-11-20 15:46:04 +0100
commit7c54c63ac14eb8f5ce0e364d709988fcfe4dda64 (patch)
tree53b4461e343e3dac5656cf2c17e7400136ef5e66 /lib/backup/database.rb
parentb036300f0ac7442c488a6eef6a85c3f6cb77d7fd (diff)
downloadgitlab-ce-7c54c63ac14eb8f5ce0e364d709988fcfe4dda64.tar.gz
Add CRON=1 backup setting for quiet backups
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r--lib/backup/database.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index ea659e3b605..9ab6aca276d 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -13,10 +13,10 @@ module Backup
def dump
success = case config["adapter"]
when /^mysql/ then
- print "Dumping MySQL database #{config['database']} ... "
+ $progress.print "Dumping MySQL database #{config['database']} ... "
system('mysqldump', *mysql_args, config['database'], out: db_file_name)
when "postgresql" then
- print "Dumping PostgreSQL database #{config['database']} ... "
+ $progress.print "Dumping PostgreSQL database #{config['database']} ... "
pg_env
system('pg_dump', config['database'], out: db_file_name)
end
@@ -27,10 +27,10 @@ module Backup
def restore
success = case config["adapter"]
when /^mysql/ then
- print "Restoring MySQL database #{config['database']} ... "
+ $progress.print "Restoring MySQL database #{config['database']} ... "
system('mysql', *mysql_args, config['database'], in: db_file_name)
when "postgresql" then
- print "Restoring PostgreSQL database #{config['database']} ... "
+ $progress.print "Restoring PostgreSQL database #{config['database']} ... "
# Drop all tables because PostgreSQL DB dumps do not contain DROP TABLE
# statements like MySQL.
Rake::Task["gitlab:db:drop_all_tables"].invoke
@@ -69,9 +69,9 @@ module Backup
def report_success(success)
if success
- puts '[DONE]'.green
+ $progress.puts '[DONE]'.green
else
- puts '[FAILED]'.red
+ $progress.puts '[FAILED]'.red
end
end
end