OSDN Git Service

move old repositories dir to one with timestamp
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fri, 5 Apr 2013 16:48:56 +0000 (19:48 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fri, 5 Apr 2013 16:48:56 +0000 (19:48 +0300)
lib/backup/repository.rb

index c1d0896..4c72e8e 100644 (file)
@@ -29,7 +29,7 @@ module Backup
     def restore
       if File.exists?(repos_path)
         # Move repos dir to 'repositories.old' dir
-        bk_repos_path = File.join(repos_path, '..', 'repositories.old')
+        bk_repos_path = File.join(repos_path, '..', 'repositories.old.' + Time.now.to_i.to_s)
         FileUtils.mv(repos_path, bk_repos_path)
       end