berty 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/berty/server.rb +8 -2
  2. metadata +3 -3
data/lib/berty/server.rb CHANGED
@@ -36,9 +36,15 @@ module Berty
36
36
  def backup!
37
37
  run "mkdir -p #{backup_path}"
38
38
  for dir in directories
39
- destination =
39
+ run "mkdir -p #{dir[:destination]}/0 #{dir[:destination]}/1 #{dir[:destination]}/2 #{dir[:destination]}/3 #{dir[:destination]}/4"
40
+ run "rm -Rf #{dir[:destination]}/4/"
41
+ run "mv #{dir[:destination]}/3/ #{dir[:destination]}/4/"
42
+ run "mv #{dir[:destination]}/2/ #{dir[:destination]}/3/"
43
+ run "mv #{dir[:destination]}/1/ #{dir[:destination]}/2/"
44
+ Berty.logger.info " archiving previous backup: '#{dir[:path]}' to '#{dir[:destination]}/1/'"
45
+ run "cp -a #{dir[:destination]}/0/ #{dir[:destination]}/1/"
40
46
  Berty.logger.info " starting backup of: '#{dir[:path]}' to '#{dir[:destination]}'"
41
- run "rsync -a #{username}@#{hostname}:#{dir[:path]}/ #{dir[:destination]}"
47
+ run "rsync -a #{username}@#{hostname}:#{dir[:path]}/ #{dir[:destination]}/0/"
42
48
  Berty.logger.info " finished backup of: '#{dir[:path]}' to '#{dir[:destination]}'"
43
49
  end
44
50
  backup_mysql!
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Cooke
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-23 00:00:00 +00:00
17
+ date: 2010-04-07 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20