backup 3.0.20 → 3.0.21
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -5
- data/Gemfile.lock +46 -50
- data/README.md +54 -27
- data/lib/backup.rb +16 -39
- data/lib/backup/archive.rb +42 -18
- data/lib/backup/cleaner.rb +110 -25
- data/lib/backup/cli/helpers.rb +17 -32
- data/lib/backup/cli/utility.rb +46 -107
- data/lib/backup/compressor/base.rb +14 -2
- data/lib/backup/compressor/bzip2.rb +10 -24
- data/lib/backup/compressor/gzip.rb +10 -24
- data/lib/backup/compressor/lzma.rb +10 -23
- data/lib/backup/compressor/pbzip2.rb +12 -32
- data/lib/backup/config.rb +171 -0
- data/lib/backup/configuration/compressor/base.rb +1 -2
- data/lib/backup/configuration/compressor/pbzip2.rb +4 -4
- data/lib/backup/configuration/database/base.rb +2 -1
- data/lib/backup/configuration/database/mongodb.rb +8 -0
- data/lib/backup/configuration/database/mysql.rb +4 -0
- data/lib/backup/configuration/database/postgresql.rb +4 -0
- data/lib/backup/configuration/database/redis.rb +4 -0
- data/lib/backup/configuration/database/riak.rb +5 -1
- data/lib/backup/configuration/encryptor/base.rb +1 -2
- data/lib/backup/configuration/encryptor/open_ssl.rb +1 -1
- data/lib/backup/configuration/helpers.rb +7 -2
- data/lib/backup/configuration/notifier/base.rb +4 -28
- data/lib/backup/configuration/storage/base.rb +1 -1
- data/lib/backup/configuration/storage/dropbox.rb +14 -4
- data/lib/backup/configuration/syncer/base.rb +10 -0
- data/lib/backup/configuration/syncer/rsync/base.rb +28 -0
- data/lib/backup/configuration/syncer/rsync/local.rb +11 -0
- data/lib/backup/configuration/syncer/rsync/pull.rb +11 -0
- data/lib/backup/configuration/syncer/rsync/push.rb +31 -0
- data/lib/backup/configuration/syncer/s3.rb +0 -4
- data/lib/backup/database/base.rb +25 -7
- data/lib/backup/database/mongodb.rb +112 -75
- data/lib/backup/database/mysql.rb +54 -29
- data/lib/backup/database/postgresql.rb +60 -42
- data/lib/backup/database/redis.rb +61 -39
- data/lib/backup/database/riak.rb +35 -11
- data/lib/backup/dependency.rb +4 -5
- data/lib/backup/encryptor/base.rb +13 -1
- data/lib/backup/encryptor/gpg.rb +39 -39
- data/lib/backup/encryptor/open_ssl.rb +28 -38
- data/lib/backup/logger.rb +20 -11
- data/lib/backup/model.rb +206 -163
- data/lib/backup/notifier/base.rb +27 -25
- data/lib/backup/notifier/campfire.rb +7 -13
- data/lib/backup/notifier/hipchat.rb +28 -28
- data/lib/backup/notifier/mail.rb +24 -26
- data/lib/backup/notifier/presently.rb +10 -18
- data/lib/backup/notifier/prowl.rb +9 -17
- data/lib/backup/notifier/twitter.rb +11 -18
- data/lib/backup/package.rb +47 -0
- data/lib/backup/packager.rb +81 -16
- data/lib/backup/splitter.rb +48 -35
- data/lib/backup/storage/base.rb +44 -172
- data/lib/backup/storage/cloudfiles.rb +31 -46
- data/lib/backup/storage/cycler.rb +117 -0
- data/lib/backup/storage/dropbox.rb +92 -76
- data/lib/backup/storage/ftp.rb +30 -40
- data/lib/backup/storage/local.rb +44 -45
- data/lib/backup/storage/ninefold.rb +55 -49
- data/lib/backup/storage/rsync.rb +49 -56
- data/lib/backup/storage/s3.rb +33 -44
- data/lib/backup/storage/scp.rb +21 -48
- data/lib/backup/storage/sftp.rb +26 -40
- data/lib/backup/syncer/base.rb +7 -0
- data/lib/backup/syncer/rsync/base.rb +78 -0
- data/lib/backup/syncer/rsync/local.rb +53 -0
- data/lib/backup/syncer/rsync/pull.rb +38 -0
- data/lib/backup/syncer/rsync/push.rb +113 -0
- data/lib/backup/syncer/s3.rb +42 -32
- data/lib/backup/version.rb +1 -1
- data/spec/archive_spec.rb +235 -69
- data/spec/cleaner_spec.rb +304 -0
- data/spec/cli/helpers_spec.rb +142 -1
- data/spec/cli/utility_spec.rb +338 -13
- data/spec/compressor/base_spec.rb +31 -0
- data/spec/compressor/bzip2_spec.rb +60 -35
- data/spec/compressor/gzip_spec.rb +60 -35
- data/spec/compressor/lzma_spec.rb +60 -35
- data/spec/compressor/pbzip2_spec.rb +98 -37
- data/spec/config_spec.rb +321 -0
- data/spec/configuration/base_spec.rb +4 -4
- data/spec/configuration/compressor/bzip2_spec.rb +1 -0
- data/spec/configuration/compressor/gzip_spec.rb +1 -0
- data/spec/configuration/compressor/lzma_spec.rb +1 -0
- data/spec/configuration/compressor/pbzip2_spec.rb +32 -0
- data/spec/configuration/database/base_spec.rb +2 -1
- data/spec/configuration/database/mongodb_spec.rb +26 -16
- data/spec/configuration/database/mysql_spec.rb +4 -0
- data/spec/configuration/database/postgresql_spec.rb +4 -0
- data/spec/configuration/database/redis_spec.rb +4 -0
- data/spec/configuration/database/riak_spec.rb +4 -0
- data/spec/configuration/encryptor/gpg_spec.rb +1 -0
- data/spec/configuration/encryptor/open_ssl_spec.rb +1 -0
- data/spec/configuration/notifier/base_spec.rb +32 -0
- data/spec/configuration/notifier/campfire_spec.rb +1 -0
- data/spec/configuration/notifier/hipchat_spec.rb +1 -0
- data/spec/configuration/notifier/mail_spec.rb +1 -0
- data/spec/configuration/notifier/presently_spec.rb +1 -0
- data/spec/configuration/notifier/prowl_spec.rb +1 -0
- data/spec/configuration/notifier/twitter_spec.rb +1 -0
- data/spec/configuration/storage/cloudfiles_spec.rb +1 -0
- data/spec/configuration/storage/dropbox_spec.rb +4 -3
- data/spec/configuration/storage/ftp_spec.rb +1 -0
- data/spec/configuration/storage/local_spec.rb +1 -0
- data/spec/configuration/storage/ninefold_spec.rb +1 -0
- data/spec/configuration/storage/rsync_spec.rb +3 -1
- data/spec/configuration/storage/s3_spec.rb +1 -0
- data/spec/configuration/storage/scp_spec.rb +1 -0
- data/spec/configuration/storage/sftp_spec.rb +1 -0
- data/spec/configuration/syncer/rsync/base_spec.rb +33 -0
- data/spec/configuration/syncer/rsync/local_spec.rb +10 -0
- data/spec/configuration/syncer/rsync/pull_spec.rb +10 -0
- data/spec/configuration/syncer/{rsync_spec.rb → rsync/push_spec.rb} +12 -15
- data/spec/configuration/syncer/s3_spec.rb +2 -3
- data/spec/database/base_spec.rb +35 -20
- data/spec/database/mongodb_spec.rb +298 -119
- data/spec/database/mysql_spec.rb +147 -72
- data/spec/database/postgresql_spec.rb +155 -100
- data/spec/database/redis_spec.rb +200 -97
- data/spec/database/riak_spec.rb +82 -24
- data/spec/dependency_spec.rb +49 -0
- data/spec/encryptor/base_spec.rb +30 -0
- data/spec/encryptor/gpg_spec.rb +105 -28
- data/spec/encryptor/open_ssl_spec.rb +85 -114
- data/spec/logger_spec.rb +74 -8
- data/spec/model_spec.rb +528 -220
- data/spec/notifier/base_spec.rb +89 -0
- data/spec/notifier/campfire_spec.rb +147 -119
- data/spec/notifier/hipchat_spec.rb +140 -145
- data/spec/notifier/mail_spec.rb +190 -248
- data/spec/notifier/presently_spec.rb +147 -282
- data/spec/notifier/prowl_spec.rb +79 -111
- data/spec/notifier/twitter_spec.rb +87 -106
- data/spec/package_spec.rb +61 -0
- data/spec/packager_spec.rb +154 -0
- data/spec/spec_helper.rb +36 -13
- data/spec/splitter_spec.rb +90 -41
- data/spec/storage/base_spec.rb +95 -239
- data/spec/storage/cloudfiles_spec.rb +185 -75
- data/spec/storage/cycler_spec.rb +239 -0
- data/spec/storage/dropbox_spec.rb +318 -87
- data/spec/storage/ftp_spec.rb +165 -152
- data/spec/storage/local_spec.rb +206 -54
- data/spec/storage/ninefold_spec.rb +264 -128
- data/spec/storage/rsync_spec.rb +244 -163
- data/spec/storage/s3_spec.rb +175 -64
- data/spec/storage/scp_spec.rb +156 -150
- data/spec/storage/sftp_spec.rb +153 -135
- data/spec/syncer/base_spec.rb +22 -0
- data/spec/syncer/rsync/base_spec.rb +118 -0
- data/spec/syncer/rsync/local_spec.rb +121 -0
- data/spec/syncer/rsync/pull_spec.rb +90 -0
- data/spec/syncer/rsync/push_spec.rb +327 -0
- data/spec/syncer/s3_spec.rb +180 -91
- data/templates/cli/utility/config +1 -1
- data/templates/cli/utility/database/mongodb +4 -0
- data/templates/cli/utility/database/mysql +3 -0
- data/templates/cli/utility/database/postgresql +3 -0
- data/templates/cli/utility/database/redis +3 -0
- data/templates/cli/utility/database/riak +3 -0
- data/templates/cli/utility/storage/dropbox +4 -1
- data/templates/cli/utility/syncer/rsync_local +12 -0
- data/templates/cli/utility/syncer/{rsync → rsync_pull} +2 -2
- data/templates/cli/utility/syncer/rsync_push +17 -0
- data/templates/storage/dropbox/authorization_url.erb +1 -1
- metadata +42 -17
- data/lib/backup/configuration/syncer/rsync.rb +0 -45
- data/lib/backup/finder.rb +0 -87
- data/lib/backup/storage/object.rb +0 -47
- data/lib/backup/syncer/rsync.rb +0 -152
- data/spec/backup_spec.rb +0 -11
- data/spec/finder_spec.rb +0 -91
- data/spec/storage/object_spec.rb +0 -74
- data/spec/syncer/rsync_spec.rb +0 -195
data/spec/syncer/s3_spec.rb
CHANGED
@@ -3,136 +3,225 @@
|
|
3
3
|
require File.expand_path('../../spec_helper.rb', __FILE__)
|
4
4
|
|
5
5
|
describe Backup::Syncer::S3 do
|
6
|
-
|
7
|
-
let(:s3) do
|
6
|
+
let(:syncer) do
|
8
7
|
Backup::Syncer::S3.new do |s3|
|
9
8
|
s3.access_key_id = 'my_access_key_id'
|
10
9
|
s3.secret_access_key = 'my_secret_access_key'
|
11
10
|
s3.bucket = 'my-bucket'
|
12
|
-
s3.path = "/
|
13
|
-
s3.mirror = true
|
11
|
+
s3.path = "/my_backups"
|
14
12
|
|
15
13
|
s3.directories do |directory|
|
16
|
-
directory.add "/some/
|
17
|
-
directory.add "/
|
14
|
+
directory.add "/some/directory"
|
15
|
+
directory.add "~/home/directory"
|
18
16
|
end
|
19
|
-
end
|
20
|
-
end
|
21
17
|
|
22
|
-
|
23
|
-
|
18
|
+
s3.mirror = true
|
19
|
+
s3.additional_options = ['--opt-a', '--opt-b']
|
20
|
+
end
|
24
21
|
end
|
25
22
|
|
26
|
-
|
27
|
-
s3.access_key_id.should == 'my_access_key_id'
|
28
|
-
s3.secret_access_key.should == 'my_secret_access_key'
|
29
|
-
s3.bucket.should == 'my-bucket'
|
30
|
-
s3.path.should == 'backups'
|
31
|
-
s3.mirror.should == '--delete'
|
32
|
-
s3.directories.should == ["/some/random/directory", "/another/random/directory"]
|
33
|
-
end
|
23
|
+
describe '#initialize' do
|
34
24
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
25
|
+
it 'should have defined the configuration properly' do
|
26
|
+
syncer.access_key_id.should == 'my_access_key_id'
|
27
|
+
syncer.secret_access_key.should == 'my_secret_access_key'
|
28
|
+
syncer.bucket.should == 'my-bucket'
|
29
|
+
syncer.path.should == '/my_backups'
|
30
|
+
syncer.directories.should == ["/some/directory", "~/home/directory"]
|
31
|
+
syncer.mirror.should == true
|
32
|
+
syncer.additional_options.should == ['--opt-a', '--opt-b']
|
41
33
|
end
|
42
34
|
|
43
|
-
|
44
|
-
|
45
|
-
|
35
|
+
context 'when options are not set' do
|
36
|
+
it 'should use default values' do
|
37
|
+
syncer = Backup::Syncer::S3.new
|
38
|
+
syncer.access_key_id.should == nil
|
39
|
+
syncer.secret_access_key.should == nil
|
40
|
+
syncer.bucket.should == nil
|
41
|
+
syncer.path.should == 'backups'
|
42
|
+
syncer.directories.should == []
|
43
|
+
syncer.mirror.should == false
|
44
|
+
syncer.additional_options.should == []
|
45
|
+
end
|
46
46
|
end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
48
|
+
context 'when setting configuration defaults' do
|
49
|
+
after { Backup::Configuration::Syncer::S3.clear_defaults! }
|
50
|
+
|
51
|
+
it 'should use the configured defaults' do
|
52
|
+
Backup::Configuration::Syncer::S3.defaults do |s3|
|
53
|
+
s3.access_key_id = 'some_access_key_id'
|
54
|
+
s3.secret_access_key = 'some_secret_access_key'
|
55
|
+
s3.bucket = 'some_bucket'
|
56
|
+
s3.path = 'some_path'
|
57
|
+
#s3.directories = 'cannot_have_a_default_value'
|
58
|
+
s3.mirror = 'some_mirror'
|
59
|
+
s3.additional_options = 'some_additional_options'
|
60
|
+
end
|
61
|
+
syncer = Backup::Syncer::S3.new
|
62
|
+
syncer.access_key_id.should == 'some_access_key_id'
|
63
|
+
syncer.secret_access_key.should == 'some_secret_access_key'
|
64
|
+
syncer.bucket.should == 'some_bucket'
|
65
|
+
syncer.path.should == 'some_path'
|
66
|
+
syncer.directories.should == []
|
67
|
+
syncer.mirror.should == 'some_mirror'
|
68
|
+
syncer.additional_options.should == 'some_additional_options'
|
69
|
+
end
|
62
70
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
71
|
+
it 'should override the configured defaults' do
|
72
|
+
Backup::Configuration::Syncer::S3.defaults do |s3|
|
73
|
+
s3.access_key_id = 'old_access_key_id'
|
74
|
+
s3.secret_access_key = 'old_secret_access_key'
|
75
|
+
s3.bucket = 'old_bucket'
|
76
|
+
s3.path = 'old_path'
|
77
|
+
#s3.directories = 'cannot_have_a_default_value'
|
78
|
+
s3.mirror = 'old_mirror'
|
79
|
+
s3.additional_options = 'old_additional_options'
|
80
|
+
end
|
81
|
+
syncer = Backup::Syncer::S3.new do |s3|
|
82
|
+
s3.access_key_id = 'new_access_key_id'
|
83
|
+
s3.secret_access_key = 'new_secret_access_key'
|
84
|
+
s3.bucket = 'new_bucket'
|
85
|
+
s3.path = 'new_path'
|
86
|
+
s3.directories = 'new_directories'
|
87
|
+
s3.mirror = 'new_mirror'
|
88
|
+
s3.additional_options = 'new_additional_options'
|
89
|
+
end
|
90
|
+
|
91
|
+
syncer.access_key_id.should == 'new_access_key_id'
|
92
|
+
syncer.secret_access_key.should == 'new_secret_access_key'
|
93
|
+
syncer.bucket.should == 'new_bucket'
|
94
|
+
syncer.path.should == 'new_path'
|
95
|
+
syncer.directories.should == 'new_directories'
|
96
|
+
syncer.mirror.should == 'new_mirror'
|
97
|
+
syncer.additional_options.should == 'new_additional_options'
|
68
98
|
end
|
99
|
+
end # context 'when setting configuration defaults'
|
100
|
+
end # describe '#initialize'
|
101
|
+
|
102
|
+
describe '#perform!' do
|
103
|
+
let(:s) { sequence '' }
|
104
|
+
|
105
|
+
before do
|
106
|
+
syncer.expects(:utility).twice.with(:s3sync).returns('s3sync')
|
107
|
+
syncer.expects(:options).twice.returns('options_output')
|
69
108
|
end
|
70
109
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
110
|
+
it 'should sync two directories' do
|
111
|
+
syncer.expects(:set_environment_variables!).in_sequence(s)
|
112
|
+
|
113
|
+
# first directory
|
114
|
+
Backup::Logger.expects(:message).in_sequence(s).with(
|
115
|
+
"Syncer::S3 started syncing '/some/directory'."
|
116
|
+
)
|
117
|
+
syncer.expects(:run).in_sequence(s).with(
|
118
|
+
"s3sync options_output '/some/directory' 'my-bucket:my_backups'"
|
119
|
+
).returns('messages from stdout')
|
120
|
+
Backup::Logger.expects(:silent).in_sequence(s).with('messages from stdout')
|
121
|
+
|
122
|
+
# second directory
|
123
|
+
Backup::Logger.expects(:message).in_sequence(s).with(
|
124
|
+
"Syncer::S3 started syncing '~/home/directory'."
|
125
|
+
)
|
126
|
+
syncer.expects(:run).in_sequence(s).with(
|
127
|
+
"s3sync options_output '#{ File.expand_path('~/home/directory') }' " +
|
128
|
+
"'my-bucket:my_backups'"
|
129
|
+
).returns('messages from stdout')
|
130
|
+
Backup::Logger.expects(:silent).in_sequence(s).with('messages from stdout')
|
131
|
+
|
132
|
+
syncer.expects(:unset_environment_variables!).in_sequence(s)
|
133
|
+
|
134
|
+
syncer.perform!
|
135
|
+
end
|
136
|
+
end # describe '#perform!'
|
76
137
|
|
77
|
-
|
78
|
-
|
79
|
-
|
138
|
+
describe '#directories' do
|
139
|
+
context 'when no block is given' do
|
140
|
+
it 'should return @directories' do
|
141
|
+
syncer.directories.should ==
|
142
|
+
['/some/directory', '~/home/directory']
|
80
143
|
end
|
81
144
|
end
|
82
|
-
end
|
83
145
|
|
84
|
-
|
85
|
-
|
86
|
-
|
146
|
+
context 'when a block is given' do
|
147
|
+
it 'should evalute the block, allowing #add to add directories' do
|
148
|
+
syncer.directories do
|
149
|
+
add '/new/path'
|
150
|
+
add '~/new/home/path'
|
151
|
+
end
|
152
|
+
syncer.directories.should == [
|
153
|
+
'/some/directory',
|
154
|
+
'~/home/directory',
|
155
|
+
'/new/path',
|
156
|
+
'~/new/home/path'
|
157
|
+
]
|
158
|
+
end
|
87
159
|
end
|
88
|
-
end
|
160
|
+
end # describe '#directories'
|
89
161
|
|
90
|
-
describe '#
|
91
|
-
it do
|
92
|
-
|
93
|
-
|
162
|
+
describe '#add' do
|
163
|
+
it 'should add the given path to @directories' do
|
164
|
+
syncer.add '/my/path'
|
165
|
+
syncer.directories.should ==
|
166
|
+
['/some/directory', '~/home/directory', '/my/path']
|
94
167
|
end
|
95
168
|
end
|
96
169
|
|
97
|
-
describe '#
|
98
|
-
it do
|
99
|
-
|
170
|
+
describe '#dest_path' do
|
171
|
+
it 'should remove any preceeding "/" from @path' do
|
172
|
+
syncer.send(:dest_path).should == 'my_backups'
|
100
173
|
end
|
101
|
-
end
|
102
174
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
s3.directories = []
|
107
|
-
s3.directories.should == []
|
108
|
-
end
|
175
|
+
it 'should set @dest_path' do
|
176
|
+
syncer.send(:dest_path)
|
177
|
+
syncer.instance_variable_get(:@dest_path).should == 'my_backups'
|
109
178
|
end
|
110
179
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
s3.directories.should == ['directory1', 'directory1/directory2', 'directory1/directory2/directory3']
|
115
|
-
end
|
180
|
+
it 'should return @dest_path if already set' do
|
181
|
+
syncer.instance_variable_set(:@dest_path, 'foo')
|
182
|
+
syncer.send(:dest_path).should == 'foo'
|
116
183
|
end
|
117
184
|
end
|
118
185
|
|
119
186
|
describe '#options' do
|
120
|
-
|
121
|
-
|
187
|
+
context 'when @mirror is true' do
|
188
|
+
it 'should return the options with mirroring enabled' do
|
189
|
+
syncer.send(:options).should ==
|
190
|
+
'--verbose --recursive --delete --opt-a --opt-b'
|
191
|
+
end
|
122
192
|
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe '#perform' do
|
126
|
-
it 'should sync two directories' do
|
127
|
-
s3.expects(:utility).with(:s3sync).returns(:s3sync).twice
|
128
|
-
|
129
|
-
Backup::Logger.expects(:message).with("Backup::Syncer::S3 started syncing '/some/random/directory'.")
|
130
|
-
s3.expects(:run).with("s3sync --verbose --recursive --delete '/some/random/directory' 'my-bucket:backups'")
|
131
193
|
|
132
|
-
|
133
|
-
|
194
|
+
context 'when @mirror is false' do
|
195
|
+
before { syncer.mirror = false }
|
196
|
+
it 'should return the options without mirroring enabled' do
|
197
|
+
syncer.send(:options).should ==
|
198
|
+
'--verbose --recursive --opt-a --opt-b'
|
199
|
+
end
|
200
|
+
end
|
134
201
|
|
135
|
-
|
202
|
+
context 'with no additional options' do
|
203
|
+
before { syncer.additional_options = [] }
|
204
|
+
it 'should return the options without additional options' do
|
205
|
+
syncer.send(:options).should ==
|
206
|
+
'--verbose --recursive --delete'
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end # describe '#options'
|
210
|
+
|
211
|
+
describe 'changing environment variables' do
|
212
|
+
before { @env = ENV }
|
213
|
+
after { ENV.replace(@env) }
|
214
|
+
|
215
|
+
it 'should set and unset environment variables' do
|
216
|
+
syncer.send(:set_environment_variables!)
|
217
|
+
ENV['AWS_ACCESS_KEY_ID'].should == 'my_access_key_id'
|
218
|
+
ENV['AWS_SECRET_ACCESS_KEY'].should == 'my_secret_access_key'
|
219
|
+
ENV['AWS_CALLING_FORMAT'].should == 'SUBDOMAIN'
|
220
|
+
|
221
|
+
syncer.send(:unset_environment_variables!)
|
222
|
+
ENV['AWS_ACCESS_KEY_ID'].should == nil
|
223
|
+
ENV['AWS_SECRET_ACCESS_KEY'].should == nil
|
224
|
+
ENV['AWS_CALLING_FORMAT'].should == nil
|
136
225
|
end
|
137
226
|
end
|
138
227
|
|
@@ -26,6 +26,6 @@ end
|
|
26
26
|
|
27
27
|
##
|
28
28
|
# Load all models from the models directory (after the above global configuration blocks)
|
29
|
-
Dir[File.join(File.dirname(
|
29
|
+
Dir[File.join(File.dirname(Config.config_file), "models", "*.rb")].each do |model|
|
30
30
|
instance_eval(File.read(model))
|
31
31
|
end
|
@@ -11,4 +11,8 @@
|
|
11
11
|
db.only_collections = ['only', 'these' 'collections']
|
12
12
|
db.additional_options = []
|
13
13
|
db.lock = false
|
14
|
+
# Optional: Use to set the location of these utilities
|
15
|
+
# if they cannot be found by their name in your $PATH
|
16
|
+
# db.mongodump_utility = '/opt/local/bin/mongodump'
|
17
|
+
# db.mongo_utility = '/opt/local/bin/mongo'
|
14
18
|
end
|
@@ -11,4 +11,7 @@
|
|
11
11
|
db.skip_tables = ['skip', 'these', 'tables']
|
12
12
|
db.only_tables = ['only', 'these' 'tables']
|
13
13
|
db.additional_options = ['--quick', '--single-transaction']
|
14
|
+
# Optional: Use to set the location of this utility
|
15
|
+
# if it cannot be found by name in your $PATH
|
16
|
+
# db.mysqldump_utility = '/opt/local/bin/mysqldump'
|
14
17
|
end
|
@@ -11,4 +11,7 @@
|
|
11
11
|
db.skip_tables = ['skip', 'these', 'tables']
|
12
12
|
db.only_tables = ['only', 'these' 'tables']
|
13
13
|
db.additional_options = ['-xc', '-E=utf8']
|
14
|
+
# Optional: Use to set the location of this utility
|
15
|
+
# if it cannot be found by name in your $PATH
|
16
|
+
# db.pg_dump_utility = '/opt/local/bin/pg_dump'
|
14
17
|
end
|
@@ -6,7 +6,10 @@
|
|
6
6
|
store_with Dropbox do |db|
|
7
7
|
db.api_key = 'my_api_key'
|
8
8
|
db.api_secret = 'my_api_secret'
|
9
|
-
|
9
|
+
# Dropbox Access Type
|
10
|
+
# The default value is :app_folder
|
11
|
+
# Change this to :dropbox if needed
|
12
|
+
# db.access_type = :dropbox
|
10
13
|
db.path = '/path/to/my/backups'
|
11
14
|
db.keep = 25
|
12
15
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
##
|
2
|
+
# RSync::Local [Syncer]
|
3
|
+
#
|
4
|
+
sync_with RSync::Local do |rsync|
|
5
|
+
rsync.path = "~/backups/"
|
6
|
+
rsync.mirror = true
|
7
|
+
|
8
|
+
rsync.directories do |directory|
|
9
|
+
directory.add "/var/apps/my_app/public/uploads"
|
10
|
+
directory.add "/var/apps/my_app/logs"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
##
|
2
|
+
# RSync::Push [Syncer]
|
3
|
+
#
|
4
|
+
sync_with RSync::Push do |rsync|
|
5
|
+
rsync.ip = "123.45.678.90"
|
6
|
+
rsync.port = 22
|
7
|
+
rsync.username = "my_username"
|
8
|
+
rsync.password = "my_password"
|
9
|
+
rsync.path = "~/backups/"
|
10
|
+
rsync.mirror = true
|
11
|
+
rsync.compress = true
|
12
|
+
|
13
|
+
rsync.directories do |directory|
|
14
|
+
directory.add "/var/apps/my_app/public/uploads"
|
15
|
+
directory.add "/var/apps/my_app/logs"
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.21
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70322872021320 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.14.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70322872021320
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: POpen4
|
27
|
-
requirement: &
|
27
|
+
requirement: &70322872019160 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.1.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70322872019160
|
36
36
|
description:
|
37
37
|
email: meskyanichi@gmail.com
|
38
38
|
executables:
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- lib/backup/compressor/gzip.rb
|
61
61
|
- lib/backup/compressor/lzma.rb
|
62
62
|
- lib/backup/compressor/pbzip2.rb
|
63
|
+
- lib/backup/config.rb
|
63
64
|
- lib/backup/configuration/base.rb
|
64
65
|
- lib/backup/configuration/compressor/base.rb
|
65
66
|
- lib/backup/configuration/compressor/bzip2.rb
|
@@ -93,7 +94,11 @@ files:
|
|
93
94
|
- lib/backup/configuration/storage/s3.rb
|
94
95
|
- lib/backup/configuration/storage/scp.rb
|
95
96
|
- lib/backup/configuration/storage/sftp.rb
|
96
|
-
- lib/backup/configuration/syncer/
|
97
|
+
- lib/backup/configuration/syncer/base.rb
|
98
|
+
- lib/backup/configuration/syncer/rsync/base.rb
|
99
|
+
- lib/backup/configuration/syncer/rsync/local.rb
|
100
|
+
- lib/backup/configuration/syncer/rsync/pull.rb
|
101
|
+
- lib/backup/configuration/syncer/rsync/push.rb
|
97
102
|
- lib/backup/configuration/syncer/s3.rb
|
98
103
|
- lib/backup/database/base.rb
|
99
104
|
- lib/backup/database/mongodb.rb
|
@@ -106,7 +111,6 @@ files:
|
|
106
111
|
- lib/backup/encryptor/gpg.rb
|
107
112
|
- lib/backup/encryptor/open_ssl.rb
|
108
113
|
- lib/backup/errors.rb
|
109
|
-
- lib/backup/finder.rb
|
110
114
|
- lib/backup/logger.rb
|
111
115
|
- lib/backup/model.rb
|
112
116
|
- lib/backup/notifier/base.rb
|
@@ -116,36 +120,43 @@ files:
|
|
116
120
|
- lib/backup/notifier/presently.rb
|
117
121
|
- lib/backup/notifier/prowl.rb
|
118
122
|
- lib/backup/notifier/twitter.rb
|
123
|
+
- lib/backup/package.rb
|
119
124
|
- lib/backup/packager.rb
|
120
125
|
- lib/backup/splitter.rb
|
121
126
|
- lib/backup/storage/base.rb
|
122
127
|
- lib/backup/storage/cloudfiles.rb
|
128
|
+
- lib/backup/storage/cycler.rb
|
123
129
|
- lib/backup/storage/dropbox.rb
|
124
130
|
- lib/backup/storage/ftp.rb
|
125
131
|
- lib/backup/storage/local.rb
|
126
132
|
- lib/backup/storage/ninefold.rb
|
127
|
-
- lib/backup/storage/object.rb
|
128
133
|
- lib/backup/storage/rsync.rb
|
129
134
|
- lib/backup/storage/s3.rb
|
130
135
|
- lib/backup/storage/scp.rb
|
131
136
|
- lib/backup/storage/sftp.rb
|
132
137
|
- lib/backup/syncer/base.rb
|
133
|
-
- lib/backup/syncer/rsync.rb
|
138
|
+
- lib/backup/syncer/rsync/base.rb
|
139
|
+
- lib/backup/syncer/rsync/local.rb
|
140
|
+
- lib/backup/syncer/rsync/pull.rb
|
141
|
+
- lib/backup/syncer/rsync/push.rb
|
134
142
|
- lib/backup/syncer/s3.rb
|
135
143
|
- lib/backup/template.rb
|
136
144
|
- lib/backup/version.rb
|
137
145
|
- spec/archive_spec.rb
|
138
|
-
- spec/
|
146
|
+
- spec/cleaner_spec.rb
|
139
147
|
- spec/cli/helpers_spec.rb
|
140
148
|
- spec/cli/utility_spec.rb
|
149
|
+
- spec/compressor/base_spec.rb
|
141
150
|
- spec/compressor/bzip2_spec.rb
|
142
151
|
- spec/compressor/gzip_spec.rb
|
143
152
|
- spec/compressor/lzma_spec.rb
|
144
153
|
- spec/compressor/pbzip2_spec.rb
|
154
|
+
- spec/config_spec.rb
|
145
155
|
- spec/configuration/base_spec.rb
|
146
156
|
- spec/configuration/compressor/bzip2_spec.rb
|
147
157
|
- spec/configuration/compressor/gzip_spec.rb
|
148
158
|
- spec/configuration/compressor/lzma_spec.rb
|
159
|
+
- spec/configuration/compressor/pbzip2_spec.rb
|
149
160
|
- spec/configuration/database/base_spec.rb
|
150
161
|
- spec/configuration/database/mongodb_spec.rb
|
151
162
|
- spec/configuration/database/mysql_spec.rb
|
@@ -154,6 +165,7 @@ files:
|
|
154
165
|
- spec/configuration/database/riak_spec.rb
|
155
166
|
- spec/configuration/encryptor/gpg_spec.rb
|
156
167
|
- spec/configuration/encryptor/open_ssl_spec.rb
|
168
|
+
- spec/configuration/notifier/base_spec.rb
|
157
169
|
- spec/configuration/notifier/campfire_spec.rb
|
158
170
|
- spec/configuration/notifier/hipchat_spec.rb
|
159
171
|
- spec/configuration/notifier/mail_spec.rb
|
@@ -169,7 +181,10 @@ files:
|
|
169
181
|
- spec/configuration/storage/s3_spec.rb
|
170
182
|
- spec/configuration/storage/scp_spec.rb
|
171
183
|
- spec/configuration/storage/sftp_spec.rb
|
172
|
-
- spec/configuration/syncer/
|
184
|
+
- spec/configuration/syncer/rsync/base_spec.rb
|
185
|
+
- spec/configuration/syncer/rsync/local_spec.rb
|
186
|
+
- spec/configuration/syncer/rsync/pull_spec.rb
|
187
|
+
- spec/configuration/syncer/rsync/push_spec.rb
|
173
188
|
- spec/configuration/syncer/s3_spec.rb
|
174
189
|
- spec/database/base_spec.rb
|
175
190
|
- spec/database/mongodb_spec.rb
|
@@ -177,32 +192,40 @@ files:
|
|
177
192
|
- spec/database/postgresql_spec.rb
|
178
193
|
- spec/database/redis_spec.rb
|
179
194
|
- spec/database/riak_spec.rb
|
195
|
+
- spec/dependency_spec.rb
|
196
|
+
- spec/encryptor/base_spec.rb
|
180
197
|
- spec/encryptor/gpg_spec.rb
|
181
198
|
- spec/encryptor/open_ssl_spec.rb
|
182
199
|
- spec/errors_spec.rb
|
183
|
-
- spec/finder_spec.rb
|
184
200
|
- spec/logger_spec.rb
|
185
201
|
- spec/model_spec.rb
|
202
|
+
- spec/notifier/base_spec.rb
|
186
203
|
- spec/notifier/campfire_spec.rb
|
187
204
|
- spec/notifier/hipchat_spec.rb
|
188
205
|
- spec/notifier/mail_spec.rb
|
189
206
|
- spec/notifier/presently_spec.rb
|
190
207
|
- spec/notifier/prowl_spec.rb
|
191
208
|
- spec/notifier/twitter_spec.rb
|
209
|
+
- spec/package_spec.rb
|
210
|
+
- spec/packager_spec.rb
|
192
211
|
- spec/spec_helper.rb
|
193
212
|
- spec/splitter_spec.rb
|
194
213
|
- spec/storage/base_spec.rb
|
195
214
|
- spec/storage/cloudfiles_spec.rb
|
215
|
+
- spec/storage/cycler_spec.rb
|
196
216
|
- spec/storage/dropbox_spec.rb
|
197
217
|
- spec/storage/ftp_spec.rb
|
198
218
|
- spec/storage/local_spec.rb
|
199
219
|
- spec/storage/ninefold_spec.rb
|
200
|
-
- spec/storage/object_spec.rb
|
201
220
|
- spec/storage/rsync_spec.rb
|
202
221
|
- spec/storage/s3_spec.rb
|
203
222
|
- spec/storage/scp_spec.rb
|
204
223
|
- spec/storage/sftp_spec.rb
|
205
|
-
- spec/syncer/
|
224
|
+
- spec/syncer/base_spec.rb
|
225
|
+
- spec/syncer/rsync/base_spec.rb
|
226
|
+
- spec/syncer/rsync/local_spec.rb
|
227
|
+
- spec/syncer/rsync/pull_spec.rb
|
228
|
+
- spec/syncer/rsync/push_spec.rb
|
206
229
|
- spec/syncer/s3_spec.rb
|
207
230
|
- spec/version_spec.rb
|
208
231
|
- templates/cli/utility/archive
|
@@ -235,7 +258,9 @@ files:
|
|
235
258
|
- templates/cli/utility/storage/s3
|
236
259
|
- templates/cli/utility/storage/scp
|
237
260
|
- templates/cli/utility/storage/sftp
|
238
|
-
- templates/cli/utility/syncer/
|
261
|
+
- templates/cli/utility/syncer/rsync_local
|
262
|
+
- templates/cli/utility/syncer/rsync_pull
|
263
|
+
- templates/cli/utility/syncer/rsync_push
|
239
264
|
- templates/cli/utility/syncer/s3
|
240
265
|
- templates/general/links
|
241
266
|
- templates/general/version.erb
|
@@ -265,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
290
|
version: '0'
|
266
291
|
requirements: []
|
267
292
|
rubyforge_project:
|
268
|
-
rubygems_version: 1.8.
|
293
|
+
rubygems_version: 1.8.15
|
269
294
|
signing_key:
|
270
295
|
specification_version: 3
|
271
296
|
summary: Backup is a RubyGem, written for Linux and Mac OSX, that allows you to easily
|