backup 3.0.21 → 3.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Gemfile.lock +3 -1
  2. data/README.md +4 -3
  3. data/lib/backup.rb +8 -4
  4. data/lib/backup/config.rb +1 -1
  5. data/lib/backup/configuration/syncer/cloud.rb +23 -0
  6. data/lib/backup/configuration/syncer/cloud_files.rb +30 -0
  7. data/lib/backup/configuration/syncer/s3.rb +5 -11
  8. data/lib/backup/dependency.rb +6 -0
  9. data/lib/backup/notifier/twitter.rb +1 -1
  10. data/lib/backup/syncer/base.rb +25 -0
  11. data/lib/backup/syncer/cloud.rb +187 -0
  12. data/lib/backup/syncer/cloud_files.rb +56 -0
  13. data/lib/backup/syncer/rsync/base.rb +0 -26
  14. data/lib/backup/syncer/s3.rb +21 -102
  15. data/lib/backup/version.rb +1 -1
  16. data/spec/cli/utility_spec.rb +2 -2
  17. data/spec/configuration/syncer/cloud_files_spec.rb +44 -0
  18. data/spec/configuration/syncer/s3_spec.rb +0 -4
  19. data/spec/notifier/twitter_spec.rb +3 -3
  20. data/spec/syncer/cloud_files_spec.rb +192 -0
  21. data/spec/syncer/s3_spec.rb +155 -191
  22. data/templates/cli/utility/archive +20 -8
  23. data/templates/cli/utility/database/mongodb +3 -3
  24. data/templates/cli/utility/database/mysql +4 -4
  25. data/templates/cli/utility/database/postgresql +4 -4
  26. data/templates/cli/utility/database/redis +1 -1
  27. data/templates/cli/utility/encryptor/openssl +2 -2
  28. data/templates/cli/utility/notifier/campfire +3 -3
  29. data/templates/cli/utility/notifier/hipchat +6 -6
  30. data/templates/cli/utility/notifier/mail +7 -7
  31. data/templates/cli/utility/notifier/presently +4 -4
  32. data/templates/cli/utility/notifier/prowl +2 -2
  33. data/templates/cli/utility/notifier/twitter +4 -4
  34. data/templates/cli/utility/storage/cloud_files +22 -0
  35. data/templates/cli/utility/storage/dropbox +15 -10
  36. data/templates/cli/utility/storage/ftp +4 -4
  37. data/templates/cli/utility/storage/local +1 -1
  38. data/templates/cli/utility/storage/ninefold +3 -3
  39. data/templates/cli/utility/storage/rsync +4 -4
  40. data/templates/cli/utility/storage/s3 +6 -6
  41. data/templates/cli/utility/storage/scp +4 -4
  42. data/templates/cli/utility/storage/sftp +4 -4
  43. data/templates/cli/utility/syncer/cloud_files +48 -0
  44. data/templates/cli/utility/syncer/s3 +31 -1
  45. metadata +69 -39
  46. data/templates/cli/utility/storage/cloudfiles +0 -12
@@ -12,5 +12,5 @@
12
12
  db.invoke_save = true
13
13
  # Optional: Use to set the location of this utility
14
14
  # if it cannot be found by name in your $PATH
15
- # db.redis_cli_utility = '/opt/local/bin/redis-cli'
15
+ # db.redis_cli_utility = "/opt/local/bin/redis-cli"
16
16
  end
@@ -2,8 +2,8 @@
2
2
  # OpenSSL [Encryptor]
3
3
  #
4
4
  encrypt_with OpenSSL do |encryption|
5
- encryption.password = 'my_password' # From String
6
- encryption.password_file = '/path/to/password/file' # Or from File
5
+ encryption.password = "my_password" # From String
6
+ encryption.password_file = "/path/to/password/file" # Or from File
7
7
  encryption.base64 = true
8
8
  encryption.salt = true
9
9
  end
@@ -6,7 +6,7 @@
6
6
  campfire.on_warning = true
7
7
  campfire.on_failure = true
8
8
 
9
- campfire.api_token = 'my_api_authentication_token'
10
- campfire.subdomain = 'my_subdomain'
11
- campfire.room_id = 'my_room_id'
9
+ campfire.api_token = "my_api_authentication_token"
10
+ campfire.subdomain = "my_subdomain"
11
+ campfire.room_id = "my_room_id"
12
12
  end
@@ -6,10 +6,10 @@
6
6
  hipchat.on_warning = true
7
7
  hipchat.on_failure = true
8
8
 
9
- hipchat.token = 'token'
10
- hipchat.from = 'DB Backup'
11
- hipchat.rooms_notified = ['activity']
12
- hipchat.success_color = 'green'
13
- hipchat.warning_color = 'yellow'
14
- hipchat.failure_color = 'red'
9
+ hipchat.token = "token"
10
+ hipchat.from = "DB Backup"
11
+ hipchat.rooms_notified = ["activity"]
12
+ hipchat.success_color = "green"
13
+ hipchat.warning_color = "yellow"
14
+ hipchat.failure_color = "red"
15
15
  end
@@ -10,13 +10,13 @@
10
10
  mail.on_warning = true
11
11
  mail.on_failure = true
12
12
 
13
- mail.from = 'sender@email.com'
14
- mail.to = 'receiver@email.com'
15
- mail.address = 'smtp.gmail.com'
13
+ mail.from = "sender@email.com"
14
+ mail.to = "receiver@email.com"
15
+ mail.address = "smtp.gmail.com"
16
16
  mail.port = 587
17
- mail.domain = 'your.host.name'
18
- mail.user_name = 'sender@email.com'
19
- mail.password = 'my_password'
20
- mail.authentication = 'plain'
17
+ mail.domain = "your.host.name"
18
+ mail.user_name = "sender@email.com"
19
+ mail.password = "my_password"
20
+ mail.authentication = "plain"
21
21
  mail.enable_starttls_auto = true
22
22
  end
@@ -6,8 +6,8 @@
6
6
  presently.on_warning = true
7
7
  presently.on_failure = true
8
8
 
9
- presently.subdomain = 'my_subdomain'
10
- presently.user_name = 'my_user_name'
11
- presently.password = 'my_password'
12
- presently.group_id = 'my_group_id' # optional
9
+ presently.subdomain = "my_subdomain"
10
+ presently.user_name = "my_user_name"
11
+ presently.password = "my_password"
12
+ presently.group_id = "my_group_id" # optional
13
13
  end
@@ -6,6 +6,6 @@
6
6
  prowl.on_warning = true
7
7
  prowl.on_failure = true
8
8
 
9
- prowl.application = 'my_application'
10
- prowl.api_key = 'my_api_key'
9
+ prowl.application = "my_application"
10
+ prowl.api_key = "my_api_key"
11
11
  end
@@ -6,8 +6,8 @@
6
6
  tweet.on_warning = true
7
7
  tweet.on_failure = true
8
8
 
9
- tweet.consumer_key = 'my_consumer_key'
10
- tweet.consumer_secret = 'my_consumer_secret'
11
- tweet.oauth_token = 'my_oauth_token'
12
- tweet.oauth_token_secret = 'my_oauth_token_secret'
9
+ tweet.consumer_key = "my_consumer_key"
10
+ tweet.consumer_secret = "my_consumer_secret"
11
+ tweet.oauth_token = "my_oauth_token"
12
+ tweet.oauth_token_secret = "my_oauth_token_secret"
13
13
  end
@@ -0,0 +1,22 @@
1
+ ##
2
+ # Rackspace Cloud Files [Storage]
3
+ #
4
+ # Available Auth URLs:
5
+ #
6
+ # - https://auth.api.rackspacecloud.com (US - Default)
7
+ # - https://lon.auth.api.rackspacecloud.com (UK)
8
+ #
9
+ # Servicenet:
10
+ #
11
+ # Set this to 'true' if Backup runs on a Rackspace server. It will avoid
12
+ # transfer charges and it's more performant.
13
+ #
14
+ store_with CloudFiles do |cf|
15
+ cf.api_key = "my_api_key"
16
+ cf.username = "my_username"
17
+ cf.container = "my_container"
18
+ cf.path = "/path/to/my/backups"
19
+ cf.keep = 5
20
+ cf.auth_url = "lon.auth.api.rackspacecloud.com"
21
+ cf.servicenet = false
22
+ end
@@ -1,15 +1,20 @@
1
1
  ##
2
2
  # Dropbox File Hosting Service [Storage]
3
- # Note: Initial backup must be performed manually to authorize
4
- # this machine with your Dropbox account.
3
+ #
4
+ # Access Type:
5
+ #
6
+ # - :app_folder (Default)
7
+ # - :dropbox
8
+ #
9
+ # Note:
10
+ #
11
+ # Initial backup must be performed manually to authorize
12
+ # this machine with your Dropbox account.
5
13
  #
6
14
  store_with Dropbox do |db|
7
- db.api_key = 'my_api_key'
8
- db.api_secret = 'my_api_secret'
9
- # Dropbox Access Type
10
- # The default value is :app_folder
11
- # Change this to :dropbox if needed
12
- # db.access_type = :dropbox
13
- db.path = '/path/to/my/backups'
14
- db.keep = 25
15
+ db.api_key = "my_api_key"
16
+ db.api_secret = "my_api_secret"
17
+ db.access_type = :app_folder
18
+ db.path = "/path/to/my/backups"
19
+ db.keep = 25
15
20
  end
@@ -2,11 +2,11 @@
2
2
  # FTP (File Transfer Protocol) [Storage]
3
3
  #
4
4
  store_with FTP do |server|
5
- server.username = 'my_username'
6
- server.password = 'my_password'
7
- server.ip = '123.45.678.90'
5
+ server.username = "my_username"
6
+ server.password = "my_password"
7
+ server.ip = "123.45.678.90"
8
8
  server.port = 21
9
- server.path = '~/backups/'
9
+ server.path = "~/backups/"
10
10
  server.keep = 5
11
11
  server.passive_mode = false
12
12
  end
@@ -2,6 +2,6 @@
2
2
  # Local (Copy) [Storage]
3
3
  #
4
4
  store_with Local do |local|
5
- local.path = '~/backups/'
5
+ local.path = "~/backups/"
6
6
  local.keep = 5
7
7
  end
@@ -2,8 +2,8 @@
2
2
  # Ninefold Cloud Storage [Storage]
3
3
  #
4
4
  store_with Ninefold do |nf|
5
- nf.storage_token = 'my_storage_token'
6
- nf.storage_secret = 'my_storage_secret'
7
- nf.path = '/path/to/my/backups'
5
+ nf.storage_token = "my_storage_token"
6
+ nf.storage_secret = "my_storage_secret"
7
+ nf.path = "/path/to/my/backups"
8
8
  nf.keep = 10
9
9
  end
@@ -2,10 +2,10 @@
2
2
  # RSync [Storage]
3
3
  #
4
4
  store_with RSync do |server|
5
- server.username = 'my_username'
6
- server.password = 'my_password'
7
- server.ip = '123.45.678.90'
5
+ server.username = "my_username"
6
+ server.password = "my_password"
7
+ server.ip = "123.45.678.90"
8
8
  server.port = 22
9
- server.path = '~/backups/'
9
+ server.path = "~/backups/"
10
10
  server.local = false
11
11
  end
@@ -10,10 +10,10 @@
10
10
  # - us-west-1
11
11
  #
12
12
  store_with S3 do |s3|
13
- s3.access_key_id = 'my_access_key_id'
14
- s3.secret_access_key = 'my_secret_access_key'
15
- s3.region = 'us-east-1'
16
- s3.bucket = 'bucket-name'
17
- s3.path = '/path/to/my/backups'
18
- s3.keep = 10
13
+ s3.access_key_id = "my_access_key_id"
14
+ s3.secret_access_key = "my_secret_access_key"
15
+ s3.region = "us-east-1"
16
+ s3.bucket = "bucket-name"
17
+ s3.path = "/path/to/my/backups"
18
+ s3.keep = 10
19
19
  end
@@ -2,10 +2,10 @@
2
2
  # SCP (Secure Copy) [Storage]
3
3
  #
4
4
  store_with SCP do |server|
5
- server.username = 'my_username'
6
- server.password = 'my_password'
7
- server.ip = '123.45.678.90'
5
+ server.username = "my_username"
6
+ server.password = "my_password"
7
+ server.ip = "123.45.678.90"
8
8
  server.port = 22
9
- server.path = '~/backups/'
9
+ server.path = "~/backups/"
10
10
  server.keep = 5
11
11
  end
@@ -2,10 +2,10 @@
2
2
  # SFTP (Secure File Transfer Protocol) [Storage]
3
3
  #
4
4
  store_with SFTP do |server|
5
- server.username = 'my_username'
6
- server.password = 'my_password'
7
- server.ip = '123.45.678.90'
5
+ server.username = "my_username"
6
+ server.password = "my_password"
7
+ server.ip = "123.45.678.90"
8
8
  server.port = 22
9
- server.path = '~/backups/'
9
+ server.path = "~/backups/"
10
10
  server.keep = 5
11
11
  end
@@ -0,0 +1,48 @@
1
+ ##
2
+ # Rackspace Cloud Files [Syncer]
3
+ #
4
+ # Available Auth URLs:
5
+ #
6
+ # - https://auth.api.rackspacecloud.com (US - Default)
7
+ # - https://lon.auth.api.rackspacecloud.com (UK)
8
+ #
9
+ # Servicenet:
10
+ #
11
+ # Set this to 'true' if Backup runs on a Rackspace server. It will avoid
12
+ # transfer charges and it's more performant.
13
+ #
14
+ # Mirroring:
15
+ #
16
+ # When enabled it will keep an exact mirror of your filesystem on Cloud Files. This means
17
+ # that when you remove a file from the filesystem, it will also remote it from Cloud Files.
18
+ #
19
+ # Concurrency (concurrency_type):
20
+ #
21
+ # - :threads (recommended)
22
+ # - :processes
23
+ # - false
24
+ #
25
+ # Threads are a good choice for such sync operations and doesn't consume any additional memory.
26
+ # Using :processes is discouraged as it's likely to consumes a lot of memory.
27
+ #
28
+ # Concurrency (concurrency_level):
29
+ #
30
+ # Defaults to 2, the higher the level, the faster it will sync.
31
+ # If you want a high concurrency level (>2), use :threads and not :processes.
32
+ #
33
+ sync_with CloudFiles do |cf|
34
+ cf.username = "my_username"
35
+ cf.api_key = "my_api_key"
36
+ cf.container = "my_container"
37
+ cf.auth_url = "https://auth.api.rackspacecloud.com"
38
+ cf.servicenet = false
39
+ cf.path = "/backups"
40
+ cf.mirror = true
41
+ cf.concurrency_type = :threads
42
+ cf.concurrency_level = 50
43
+
44
+ cf.directories do |directory|
45
+ directory.add "/path/to/directory/to/sync"
46
+ directory.add "/path/to/other/directory/to/sync"
47
+ end
48
+ end
@@ -1,12 +1,42 @@
1
1
  ##
2
- # Amazon Simple Storage Service [Syncer]
2
+ # Amazon S3 [Syncer]
3
+ #
4
+ # Available Regions:
5
+ #
6
+ # - ap-northeast-1
7
+ # - ap-southeast-1
8
+ # - eu-west-1
9
+ # - us-east-1
10
+ # - us-west-1
11
+ #
12
+ # Mirroring:
13
+ #
14
+ # When enabled it will keep an exact mirror of your filesystem on S3. This means
15
+ # that when you remove a file from the filesystem, it will also remote it from S3.
16
+ #
17
+ # Concurrency (concurrency_type):
18
+ #
19
+ # - :threads (recommended)
20
+ # - :processes
21
+ # - false
22
+ #
23
+ # Threads are a good choice for such sync operations and doesn't consume any additional memory.
24
+ # Using :processes is discouraged as it's likely to consumes a lot of memory.
25
+ #
26
+ # Concurrency (concurrency_level):
27
+ #
28
+ # Defaults to 2, the higher the level, the faster it will sync.
29
+ # If you want a high concurrency level (>2), use :threads and not :processes.
3
30
  #
4
31
  sync_with S3 do |s3|
5
32
  s3.access_key_id = "my_access_key_id"
6
33
  s3.secret_access_key = "my_secret_access_key"
7
34
  s3.bucket = "my-bucket"
35
+ s3.region = "us-east-1"
8
36
  s3.path = "/backups"
9
37
  s3.mirror = true
38
+ s3.concurrency_type = :threads
39
+ s3.concurrency_level = 50
10
40
 
11
41
  s3.directories do |directory|
12
42
  directory.add "/path/to/directory/to/sync"
metadata CHANGED
@@ -1,45 +1,63 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: backup
3
- version: !ruby/object:Gem::Version
4
- version: 3.0.21
3
+ version: !ruby/object:Gem::Version
4
+ hash: 43
5
5
  prerelease:
6
+ segments:
7
+ - 3
8
+ - 0
9
+ - 22
10
+ version: 3.0.22
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Michael van Rooijen
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-01-22 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-01-31 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: thor
16
- requirement: &70322872021320 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
27
+ - !ruby/object:Gem::Version
28
+ hash: 43
29
+ segments:
30
+ - 0
31
+ - 14
32
+ - 6
21
33
  version: 0.14.6
22
34
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70322872021320
25
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
26
37
  name: POpen4
27
- requirement: &70322872019160 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
28
40
  none: false
29
- requirements:
41
+ requirements:
30
42
  - - ~>
31
- - !ruby/object:Gem::Version
43
+ - !ruby/object:Gem::Version
44
+ hash: 19
45
+ segments:
46
+ - 0
47
+ - 1
48
+ - 4
32
49
  version: 0.1.4
33
50
  type: :runtime
34
- prerelease: false
35
- version_requirements: *70322872019160
51
+ version_requirements: *id002
36
52
  description:
37
53
  email: meskyanichi@gmail.com
38
- executables:
54
+ executables:
39
55
  - backup
40
56
  extensions: []
57
+
41
58
  extra_rdoc_files: []
42
- files:
59
+
60
+ files:
43
61
  - .gitignore
44
62
  - .travis.yml
45
63
  - Gemfile
@@ -95,6 +113,8 @@ files:
95
113
  - lib/backup/configuration/storage/scp.rb
96
114
  - lib/backup/configuration/storage/sftp.rb
97
115
  - lib/backup/configuration/syncer/base.rb
116
+ - lib/backup/configuration/syncer/cloud.rb
117
+ - lib/backup/configuration/syncer/cloud_files.rb
98
118
  - lib/backup/configuration/syncer/rsync/base.rb
99
119
  - lib/backup/configuration/syncer/rsync/local.rb
100
120
  - lib/backup/configuration/syncer/rsync/pull.rb
@@ -135,6 +155,8 @@ files:
135
155
  - lib/backup/storage/scp.rb
136
156
  - lib/backup/storage/sftp.rb
137
157
  - lib/backup/syncer/base.rb
158
+ - lib/backup/syncer/cloud.rb
159
+ - lib/backup/syncer/cloud_files.rb
138
160
  - lib/backup/syncer/rsync/base.rb
139
161
  - lib/backup/syncer/rsync/local.rb
140
162
  - lib/backup/syncer/rsync/pull.rb
@@ -181,6 +203,7 @@ files:
181
203
  - spec/configuration/storage/s3_spec.rb
182
204
  - spec/configuration/storage/scp_spec.rb
183
205
  - spec/configuration/storage/sftp_spec.rb
206
+ - spec/configuration/syncer/cloud_files_spec.rb
184
207
  - spec/configuration/syncer/rsync/base_spec.rb
185
208
  - spec/configuration/syncer/rsync/local_spec.rb
186
209
  - spec/configuration/syncer/rsync/pull_spec.rb
@@ -222,6 +245,7 @@ files:
222
245
  - spec/storage/scp_spec.rb
223
246
  - spec/storage/sftp_spec.rb
224
247
  - spec/syncer/base_spec.rb
248
+ - spec/syncer/cloud_files_spec.rb
225
249
  - spec/syncer/rsync/base_spec.rb
226
250
  - spec/syncer/rsync/local_spec.rb
227
251
  - spec/syncer/rsync/pull_spec.rb
@@ -249,7 +273,7 @@ files:
249
273
  - templates/cli/utility/notifier/prowl
250
274
  - templates/cli/utility/notifier/twitter
251
275
  - templates/cli/utility/splitter
252
- - templates/cli/utility/storage/cloudfiles
276
+ - templates/cli/utility/storage/cloud_files
253
277
  - templates/cli/utility/storage/dropbox
254
278
  - templates/cli/utility/storage/ftp
255
279
  - templates/cli/utility/storage/local
@@ -258,6 +282,7 @@ files:
258
282
  - templates/cli/utility/storage/s3
259
283
  - templates/cli/utility/storage/scp
260
284
  - templates/cli/utility/storage/sftp
285
+ - templates/cli/utility/syncer/cloud_files
261
286
  - templates/cli/utility/syncer/rsync_local
262
287
  - templates/cli/utility/syncer/rsync_pull
263
288
  - templates/cli/utility/syncer/rsync_push
@@ -272,31 +297,36 @@ files:
272
297
  - templates/storage/dropbox/cache_file_written.erb
273
298
  homepage: http://rubygems.org/gems/backup
274
299
  licenses: []
300
+
275
301
  post_install_message:
276
302
  rdoc_options: []
277
- require_paths:
303
+
304
+ require_paths:
278
305
  - lib
279
- required_ruby_version: !ruby/object:Gem::Requirement
306
+ required_ruby_version: !ruby/object:Gem::Requirement
280
307
  none: false
281
- requirements:
282
- - - ! '>='
283
- - !ruby/object:Gem::Version
284
- version: '0'
285
- required_rubygems_version: !ruby/object:Gem::Requirement
308
+ requirements:
309
+ - - ">="
310
+ - !ruby/object:Gem::Version
311
+ hash: 3
312
+ segments:
313
+ - 0
314
+ version: "0"
315
+ required_rubygems_version: !ruby/object:Gem::Requirement
286
316
  none: false
287
- requirements:
288
- - - ! '>='
289
- - !ruby/object:Gem::Version
290
- version: '0'
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ hash: 3
321
+ segments:
322
+ - 0
323
+ version: "0"
291
324
  requirements: []
325
+
292
326
  rubyforge_project:
293
- rubygems_version: 1.8.15
327
+ rubygems_version: 1.8.10
294
328
  signing_key:
295
329
  specification_version: 3
296
- summary: Backup is a RubyGem, written for Linux and Mac OSX, that allows you to easily
297
- perform backup operations on both your remote and local environments. It provides
298
- you with an elegant DSL in Ruby for modeling your backups. Backup has built-in support
299
- for various databases, storage protocols/services, syncers, compressors, encryptors
300
- and notifiers which you can mix and match. It was built with modularity, extensibility
301
- and simplicity in mind.
330
+ summary: Backup is a RubyGem, written for Linux and Mac OSX, that allows you to easily perform backup operations on both your remote and local environments. It provides you with an elegant DSL in Ruby for modeling your backups. Backup has built-in support for various databases, storage protocols/services, syncers, compressors, encryptors and notifiers which you can mix and match. It was built with modularity, extensibility and simplicity in mind.
302
331
  test_files: []
332
+