Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-13 20:11:54 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-13 20:11:54 +0400
commite8b963fc3254c663d16bf2b05ea30e3569aaf47b (patch)
tree714a1f516ade9d94f9da735be873b3fef8b25fc8 /lib/tasks/gitlab/backup.rake
parent81e6029406234267982d3516087133e215952e5e (diff)
parentcef76fdd17f2cb2f165900d907517857a8a73787 (diff)
Merge pull request #3858 from abalkin/issue-3857
Save backup time as is. Fixes #3857.
Diffstat (limited to 'lib/tasks/gitlab/backup.rake')
-rw-r--r--lib/tasks/gitlab/backup.rake7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake
index 0c791926c41..65d99d1aea3 100644
--- a/lib/tasks/gitlab/backup.rake
+++ b/lib/tasks/gitlab/backup.rake
@@ -11,10 +11,11 @@ namespace :gitlab do
Rake::Task["gitlab:backup:repo:create"].invoke
Rake::Task["gitlab:backup:uploads:create"].invoke
+
# saving additional informations
s = {}
s[:db_version] = "#{ActiveRecord::Migrator.current_version}"
- s[:backup_created_at] = "#{Time.now}"
+ 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/,"")
@@ -25,8 +26,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: #{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