diff options
author | Lev Abalkin <abalkin@enlnt.com> | 2013-05-06 19:58:10 -0400 |
---|---|---|
committer | Lev Abalkin <abalkin@enlnt.com> | 2013-05-06 19:58:10 -0400 |
commit | 7357ebc4a0fbf645024d0da96766bfc01f08b415 (patch) | |
tree | c599f8e6894b9225ec2fbb62e3b044e807552e29 | |
parent | 4d9bdab00501e01cc82a74ecfc4e7895421a5c2c (diff) | |
download | gitlab-ce-7357ebc4a0fbf645024d0da96766bfc01f08b415.tar.gz |
Save backup time as is. Fixes #3857.
-rw-r--r-- | lib/tasks/gitlab/backup.rake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 9f28de593e9..97eea518bc6 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -11,10 +11,12 @@ 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] = "#{Time.now}" + s[:backup_created_at] = current_time s[:gitlab_version] = %x{git rev-parse HEAD}.gsub(/\n/,"") s[:tar_version] = %x{tar --version | head -1}.gsub(/\n/,"") @@ -25,8 +27,8 @@ namespace :gitlab do end # create archive - print "Creating backup archive: #{Time.now.to_i}_gitlab_backup.tar ... " - if Kernel.system("tar -cf #{Time.now.to_i}_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml") + 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") puts "done".green else puts "failed".red |