backupgem 0.0.9 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +2 -2
- data/bin/commands.sh +2 -0
- data/examples/global.rb +28 -0
- data/examples/mediawiki.rb +24 -0
- data/examples/mediawiki_numeric.rb +19 -0
- data/examples/s3.rb +35 -0
- data/lib/backup.rb +24 -0
- data/lib/backup/actor.rb +208 -0
- data/lib/backup/actor.rb.orig +200 -0
- data/lib/backup/cli.rb +144 -0
- data/lib/backup/configuration.rb +137 -0
- data/lib/backup/date_parser.rb +37 -0
- data/lib/backup/extensions.rb +17 -0
- data/lib/backup/recipes/standard.rb +113 -0
- data/lib/backup/rotator.rb +219 -0
- data/lib/backup/s3_helpers.rb +97 -0
- data/lib/backup/ssh_helpers.rb +139 -0
- data/lib/backup/state_recorder.rb +21 -0
- data/tests/cleanup.sh +2 -0
- data/tests/tests_helper.rb +5 -0
- metadata +31 -3
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
class StateRecorder
|
4
|
+
attr_accessor :sons_since_last_promotion
|
5
|
+
attr_accessor :fathers_since_last_promotion
|
6
|
+
attr_accessor :saved_state_folder
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@sons_since_last_promotion = 0
|
10
|
+
@fathers_since_last_promotion = 0
|
11
|
+
end
|
12
|
+
|
13
|
+
# cleanup all the snapshots created by madeline
|
14
|
+
def cleanup_snapshots
|
15
|
+
files = Dir[saved_state_folder + "/*.snapshot"]
|
16
|
+
files.pop
|
17
|
+
files.sort.each do |f|
|
18
|
+
FileUtils.rm(f, :verbose => false)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/tests/cleanup.sh
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
#!/usr/bin/bash
|
2
|
+
LOOK_IN="/var/local/backups/mediawiki/sons"; COUNT=`ls -1 $LOOK_IN | wc -l`; MAX=14; if (( $COUNT > $MAX )); then let "OFFSET=$COUNT-$MAX"; i=1; for f in `ls -1 $LOOK_IN | sort`; do if (( $i <= $OFFSET )); then CMD="rm $LOOK_IN/$f"; echo $CMD; $CMD; fi; echo "$i $f"; let "i=$i + 1"; done; else true; fi
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: backupgem
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-08-
|
6
|
+
version: 0.0.11
|
7
|
+
date: 2007-08-07 00:00:00 -07:00
|
8
8
|
summary: Beginning-to-end solution for backups and rotation.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -29,8 +29,36 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Nate Murray
|
31
31
|
files:
|
32
|
-
-
|
32
|
+
- bin/backup
|
33
|
+
- bin/commands.sh
|
34
|
+
- lib/backup
|
35
|
+
- lib/backup/actor.rb
|
36
|
+
- lib/backup/actor.rb.orig
|
37
|
+
- lib/backup/cli.rb
|
38
|
+
- lib/backup/configuration.rb
|
39
|
+
- lib/backup/date_parser.rb
|
40
|
+
- lib/backup/extensions.rb
|
41
|
+
- lib/backup/recipes
|
42
|
+
- lib/backup/recipes/standard.rb
|
43
|
+
- lib/backup/rotator.rb
|
44
|
+
- lib/backup/s3_helpers.rb
|
45
|
+
- lib/backup/ssh_helpers.rb
|
46
|
+
- lib/backup/state_recorder.rb
|
47
|
+
- lib/backup.rb
|
48
|
+
- tests/actor_test.rb
|
49
|
+
- tests/cleanup.sh
|
50
|
+
- tests/optional
|
51
|
+
- tests/optional/s3_test.rb
|
52
|
+
- tests/rotation_test.rb
|
53
|
+
- tests/s3_test.rb
|
54
|
+
- tests/ssh_test.rb
|
55
|
+
- tests/tests_helper.rb
|
56
|
+
- examples/global.rb
|
57
|
+
- examples/mediawiki.rb
|
58
|
+
- examples/mediawiki_numeric.rb
|
59
|
+
- examples/s3.rb
|
33
60
|
- doc/index.html
|
61
|
+
- doc/LICENSE-GPL.txt
|
34
62
|
- doc/styles.css
|
35
63
|
- README
|
36
64
|
- CHANGELOG
|