diff options
author | Lev Abalkin <abalkin@enlnt.com> | 2013-05-08 16:39:31 -0400 |
---|---|---|
committer | Alexander Belopolsky <a@enlnt.com> | 2013-05-08 16:42:29 -0400 |
commit | cef76fdd17f2cb2f165900d907517857a8a73787 (patch) | |
tree | fec2595dfd520baad265047dffa98de898310578 /lib/tasks | |
parent | 7357ebc4a0fbf645024d0da96766bfc01f08b415 (diff) | |
download | gitlab-ce-cef76fdd17f2cb2f165900d907517857a8a73787.tar.gz |
Save backup time as is. Fixes #3857.
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/backup.rake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 97eea518bc6..b3e638400fa 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -11,12 +11,11 @@ namespace :gitlab do Rake::Task["gitlab:backup:repo:create"].invoke Rake::Task["gitlab:backup:uploads:create"].invoke - current_time = Time.now # saving additional informations s = {} s[:db_version] = "#{ActiveRecord::Migrator.current_version}" - s[:backup_created_at] = current_time + s[:backup_created_at] = Time.now s[:gitlab_version] = %x{git rev-parse HEAD}.gsub(/\n/,"") s[:tar_version] = %x{tar --version | head -1}.gsub(/\n/,"") @@ -27,8 +26,8 @@ namespace :gitlab do end # create archive - print "Creating backup archive: #{current_time.to_i}_gitlab_backup.tar ... " - if Kernel.system("tar -cf #{current_time.to_i}_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml") + print "Creating backup archive: #{s[:backup_created_at].to_i}_gitlab_backup.tar ... " + if Kernel.system("tar -cf #{s[:backup_created_at].to_i}_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml") puts "done".green else puts "failed".red |