backup 3.0.2 → 3.0.3.build.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/bin/backup +12 -190
  2. metadata +7 -191
  3. data/.gitignore +0 -2
  4. data/.infinity_test +0 -7
  5. data/.rspec +0 -3
  6. data/Gemfile +0 -17
  7. data/Gemfile.lock +0 -88
  8. data/LICENSE.md +0 -24
  9. data/README.md +0 -236
  10. data/backup.gemspec +0 -41
  11. data/lib/backup.rb +0 -148
  12. data/lib/backup/archive.rb +0 -54
  13. data/lib/backup/cli.rb +0 -50
  14. data/lib/backup/compressor/base.rb +0 -17
  15. data/lib/backup/compressor/gzip.rb +0 -61
  16. data/lib/backup/configuration/base.rb +0 -15
  17. data/lib/backup/configuration/compressor/base.rb +0 -10
  18. data/lib/backup/configuration/compressor/gzip.rb +0 -23
  19. data/lib/backup/configuration/database/base.rb +0 -18
  20. data/lib/backup/configuration/database/mongodb.rb +0 -37
  21. data/lib/backup/configuration/database/mysql.rb +0 -37
  22. data/lib/backup/configuration/database/postgresql.rb +0 -37
  23. data/lib/backup/configuration/database/redis.rb +0 -35
  24. data/lib/backup/configuration/encryptor/base.rb +0 -10
  25. data/lib/backup/configuration/encryptor/gpg.rb +0 -17
  26. data/lib/backup/configuration/encryptor/open_ssl.rb +0 -26
  27. data/lib/backup/configuration/helpers.rb +0 -54
  28. data/lib/backup/configuration/notifier/base.rb +0 -39
  29. data/lib/backup/configuration/notifier/mail.rb +0 -52
  30. data/lib/backup/configuration/storage/base.rb +0 -18
  31. data/lib/backup/configuration/storage/cloudfiles.rb +0 -21
  32. data/lib/backup/configuration/storage/dropbox.rb +0 -25
  33. data/lib/backup/configuration/storage/ftp.rb +0 -25
  34. data/lib/backup/configuration/storage/rsync.rb +0 -25
  35. data/lib/backup/configuration/storage/s3.rb +0 -25
  36. data/lib/backup/configuration/storage/scp.rb +0 -25
  37. data/lib/backup/configuration/storage/sftp.rb +0 -25
  38. data/lib/backup/database/base.rb +0 -33
  39. data/lib/backup/database/mongodb.rb +0 -137
  40. data/lib/backup/database/mysql.rb +0 -104
  41. data/lib/backup/database/postgresql.rb +0 -111
  42. data/lib/backup/database/redis.rb +0 -105
  43. data/lib/backup/encryptor/base.rb +0 -17
  44. data/lib/backup/encryptor/gpg.rb +0 -78
  45. data/lib/backup/encryptor/open_ssl.rb +0 -67
  46. data/lib/backup/finder.rb +0 -39
  47. data/lib/backup/logger.rb +0 -80
  48. data/lib/backup/model.rb +0 -249
  49. data/lib/backup/notifier/base.rb +0 -29
  50. data/lib/backup/notifier/binder.rb +0 -32
  51. data/lib/backup/notifier/mail.rb +0 -141
  52. data/lib/backup/notifier/templates/notify_failure.erb +0 -31
  53. data/lib/backup/notifier/templates/notify_success.erb +0 -16
  54. data/lib/backup/storage/base.rb +0 -67
  55. data/lib/backup/storage/cloudfiles.rb +0 -95
  56. data/lib/backup/storage/dropbox.rb +0 -82
  57. data/lib/backup/storage/ftp.rb +0 -114
  58. data/lib/backup/storage/object.rb +0 -45
  59. data/lib/backup/storage/rsync.rb +0 -100
  60. data/lib/backup/storage/s3.rb +0 -108
  61. data/lib/backup/storage/scp.rb +0 -105
  62. data/lib/backup/storage/sftp.rb +0 -106
  63. data/lib/backup/version.rb +0 -72
  64. data/lib/templates/archive +0 -4
  65. data/lib/templates/compressor/gzip +0 -4
  66. data/lib/templates/database/mongodb +0 -10
  67. data/lib/templates/database/mysql +0 -11
  68. data/lib/templates/database/postgresql +0 -11
  69. data/lib/templates/database/redis +0 -10
  70. data/lib/templates/encryptor/gpg +0 -9
  71. data/lib/templates/encryptor/openssl +0 -5
  72. data/lib/templates/notifier/mail +0 -14
  73. data/lib/templates/readme +0 -15
  74. data/lib/templates/storage/cloudfiles +0 -7
  75. data/lib/templates/storage/dropbox +0 -8
  76. data/lib/templates/storage/ftp +0 -8
  77. data/lib/templates/storage/rsync +0 -7
  78. data/lib/templates/storage/s3 +0 -8
  79. data/lib/templates/storage/scp +0 -8
  80. data/lib/templates/storage/sftp +0 -8
  81. data/spec/archive_spec.rb +0 -53
  82. data/spec/backup_spec.rb +0 -11
  83. data/spec/compressor/gzip_spec.rb +0 -59
  84. data/spec/configuration/base_spec.rb +0 -35
  85. data/spec/configuration/compressor/gzip_spec.rb +0 -28
  86. data/spec/configuration/database/base_spec.rb +0 -16
  87. data/spec/configuration/database/mongodb_spec.rb +0 -30
  88. data/spec/configuration/database/mysql_spec.rb +0 -32
  89. data/spec/configuration/database/postgresql_spec.rb +0 -32
  90. data/spec/configuration/database/redis_spec.rb +0 -30
  91. data/spec/configuration/encryptor/gpg_spec.rb +0 -25
  92. data/spec/configuration/encryptor/open_ssl_spec.rb +0 -31
  93. data/spec/configuration/notifier/mail_spec.rb +0 -32
  94. data/spec/configuration/storage/cloudfiles_spec.rb +0 -34
  95. data/spec/configuration/storage/dropbox_spec.rb +0 -40
  96. data/spec/configuration/storage/ftp_spec.rb +0 -40
  97. data/spec/configuration/storage/rsync_spec.rb +0 -37
  98. data/spec/configuration/storage/s3_spec.rb +0 -37
  99. data/spec/configuration/storage/scp_spec.rb +0 -40
  100. data/spec/configuration/storage/sftp_spec.rb +0 -40
  101. data/spec/database/base_spec.rb +0 -30
  102. data/spec/database/mongodb_spec.rb +0 -144
  103. data/spec/database/mysql_spec.rb +0 -150
  104. data/spec/database/postgresql_spec.rb +0 -164
  105. data/spec/database/redis_spec.rb +0 -122
  106. data/spec/encryptor/gpg_spec.rb +0 -57
  107. data/spec/encryptor/open_ssl_spec.rb +0 -102
  108. data/spec/logger_spec.rb +0 -37
  109. data/spec/model_spec.rb +0 -236
  110. data/spec/notifier/mail_spec.rb +0 -97
  111. data/spec/spec_helper.rb +0 -21
  112. data/spec/storage/base_spec.rb +0 -33
  113. data/spec/storage/cloudfiles_spec.rb +0 -102
  114. data/spec/storage/dropbox_spec.rb +0 -89
  115. data/spec/storage/ftp_spec.rb +0 -133
  116. data/spec/storage/object_spec.rb +0 -74
  117. data/spec/storage/rsync_spec.rb +0 -115
  118. data/spec/storage/s3_spec.rb +0 -110
  119. data/spec/storage/scp_spec.rb +0 -129
  120. data/spec/storage/sftp_spec.rb +0 -125
  121. data/spec/version_spec.rb +0 -32
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Database::PostgreSQL do
6
- before do
7
- Backup::Configuration::Database::PostgreSQL.defaults do |db|
8
- db.name = 'mydb'
9
- db.username = 'myuser'
10
- db.password = 'mypassword'
11
- db.host = 'myhost'
12
- db.port = 'myport'
13
- db.socket = 'mysocket'
14
- db.skip_tables = %w[my tables]
15
- db.only_tables = %w[my other tables]
16
- db.additional_options = %w[my options]
17
- end
18
- end
19
-
20
- it 'should set the default PostgreSQL configuration' do
21
- db = Backup::Configuration::Database::PostgreSQL
22
- db.name.should == 'mydb'
23
- db.username.should == 'myuser'
24
- db.password.should == 'mypassword'
25
- db.host.should == 'myhost'
26
- db.port.should == 'myport'
27
- db.socket.should == 'mysocket'
28
- db.skip_tables.should == %w[my tables]
29
- db.only_tables.should == %w[my other tables]
30
- db.additional_options.should == %w[my options]
31
- end
32
- end
@@ -1,30 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Database::Redis do
6
- before do
7
- Backup::Configuration::Database::Redis.defaults do |db|
8
- db.name = 'mydb'
9
- db.path = '/var/lib/redis/db'
10
- db.password = 'mypassword'
11
- db.invoke_save = true
12
- db.host = 'localhost'
13
- db.port = 123
14
- db.socket = '/redis.sock'
15
- db.additional_options = %w[my options]
16
- end
17
- end
18
-
19
- it 'should set the default Redis configuration' do
20
- db = Backup::Configuration::Database::Redis
21
- db.name.should == 'mydb'
22
- db.path.should == '/var/lib/redis/db'
23
- db.password.should == 'mypassword'
24
- db.invoke_save.should == true
25
- db.host.should == 'localhost'
26
- db.port.should == 123
27
- db.socket.should == '/redis.sock'
28
- db.additional_options.should == %w[my options]
29
- end
30
- end
@@ -1,25 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Encryptor::GPG do
6
- before do
7
- Backup::Configuration::Encryptor::GPG.defaults do |encryptor|
8
- encryptor.key = 'my_key'
9
- end
10
- end
11
-
12
- it 'should set the default encryptor configuration' do
13
- encryptor = Backup::Configuration::Encryptor::GPG
14
- encryptor.key.should == 'my_key'
15
- end
16
-
17
- describe '#clear_defaults!' do
18
- it 'should clear all the defaults, resetting them to nil' do
19
- Backup::Configuration::Encryptor::GPG.clear_defaults!
20
-
21
- encryptor = Backup::Configuration::Encryptor::GPG
22
- encryptor.key.should == nil
23
- end
24
- end
25
- end
@@ -1,31 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Encryptor::OpenSSL do
6
- before do
7
- Backup::Configuration::Encryptor::OpenSSL.defaults do |encryptor|
8
- encryptor.password = 'my_password'
9
- encryptor.base64 = true
10
- encryptor.salt = true
11
- end
12
- end
13
-
14
- it 'should set the default encryptor configuration' do
15
- encryptor = Backup::Configuration::Encryptor::OpenSSL
16
- encryptor.password.should == 'my_password'
17
- encryptor.base64.should == true
18
- encryptor.salt.should == true
19
- end
20
-
21
- describe '#clear_defaults!' do
22
- it 'should clear all the defaults, resetting them to nil' do
23
- Backup::Configuration::Encryptor::OpenSSL.clear_defaults!
24
-
25
- encryptor = Backup::Configuration::Encryptor::OpenSSL
26
- encryptor.password.should == nil
27
- encryptor.base64.should == nil
28
- encryptor.salt.should == nil
29
- end
30
- end
31
- end
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Notifier::Mail do
6
- before do
7
- Backup::Configuration::Notifier::Mail.defaults do |mail|
8
- mail.from = 'my.sender.email@gmail.com'
9
- mail.to = 'my.receiver.email@gmail.com'
10
- mail.address = 'smtp.gmail.com'
11
- mail.port = 587
12
- mail.domain = 'your.host.name'
13
- mail.user_name = 'user'
14
- mail.password = 'secret'
15
- mail.authentication = 'plain'
16
- mail.enable_starttls_auto = true
17
- end
18
- end
19
-
20
- it 'should set the default Mail configuration' do
21
- mail = Backup::Configuration::Notifier::Mail
22
- mail.from.should == 'my.sender.email@gmail.com'
23
- mail.to.should == 'my.receiver.email@gmail.com'
24
- mail.address.should == 'smtp.gmail.com'
25
- mail.port.should == 587
26
- mail.domain.should == 'your.host.name'
27
- mail.user_name.should == 'user'
28
- mail.password.should == 'secret'
29
- mail.authentication.should == 'plain'
30
- mail.enable_starttls_auto.should == true
31
- end
32
- end
@@ -1,34 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::CloudFiles do
6
- before do
7
- Backup::Configuration::Storage::CloudFiles.defaults do |cf|
8
- cf.username = 'my_username'
9
- cf.api_key = 'my_api_key'
10
- cf.container = 'my_container'
11
- cf.path = 'my_backups'
12
- end
13
- end
14
-
15
- it 'should set the default Cloud Files configuration' do
16
- cf = Backup::Configuration::Storage::CloudFiles
17
- cf.username.should == 'my_username'
18
- cf.api_key.should == 'my_api_key'
19
- cf.container.should == 'my_container'
20
- cf.path.should == 'my_backups'
21
- end
22
-
23
- describe '#clear_defaults!' do
24
- it 'should clear all the defaults, resetting them to nil' do
25
- Backup::Configuration::Storage::CloudFiles.clear_defaults!
26
-
27
- cf = Backup::Configuration::Storage::CloudFiles
28
- cf.username.should == nil
29
- cf.api_key.should == nil
30
- cf.container.should == nil
31
- cf.path.should == nil
32
- end
33
- end
34
- end
@@ -1,40 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::Dropbox do
6
- before do
7
- Backup::Configuration::Storage::Dropbox.defaults do |db|
8
- db.email = 'my@email.com'
9
- db.password = 'my_password'
10
- db.api_key = 'my_api_key'
11
- db.api_secret = 'my_secret'
12
- db.path = 'my_backups'
13
- db.keep = 20
14
- end
15
- end
16
-
17
- it 'should set the default Dropbox configuration' do
18
- db = Backup::Configuration::Storage::Dropbox
19
- db.email.should == 'my@email.com'
20
- db.password.should == 'my_password'
21
- db.api_key.should == 'my_api_key'
22
- db.api_secret.should == 'my_secret'
23
- db.path.should == 'my_backups'
24
- db.keep.should == 20
25
- end
26
-
27
- describe '#clear_defaults!' do
28
- it 'should clear all the defaults, resetting them to nil' do
29
- Backup::Configuration::Storage::Dropbox.clear_defaults!
30
-
31
- db = Backup::Configuration::Storage::Dropbox
32
- db.email.should == nil
33
- db.password.should == nil
34
- db.api_key.should == nil
35
- db.api_secret.should == nil
36
- db.path.should == nil
37
- db.keep.should == nil
38
- end
39
- end
40
- end
@@ -1,40 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::FTP do
6
- before do
7
- Backup::Configuration::Storage::FTP.defaults do |ftp|
8
- ftp.username = 'my_username'
9
- ftp.password = 'my_password'
10
- ftp.ip = '123.45.678.90'
11
- ftp.port = 21
12
- ftp.path = 'my_backups'
13
- ftp.keep = 20
14
- end
15
- end
16
-
17
- it 'should set the default ftp configuration' do
18
- ftp = Backup::Configuration::Storage::FTP
19
- ftp.username.should == 'my_username'
20
- ftp.password.should == 'my_password'
21
- ftp.ip.should == '123.45.678.90'
22
- ftp.port.should == 21
23
- ftp.path.should == 'my_backups'
24
- ftp.keep.should == 20
25
- end
26
-
27
- describe '#clear_defaults!' do
28
- it 'should clear all the defaults, resetting them to nil' do
29
- Backup::Configuration::Storage::FTP.clear_defaults!
30
-
31
- ftp = Backup::Configuration::Storage::FTP
32
- ftp.username.should == nil
33
- ftp.password.should == nil
34
- ftp.ip.should == nil
35
- ftp.port.should == nil
36
- ftp.path.should == nil
37
- ftp.keep.should == nil
38
- end
39
- end
40
- end
@@ -1,37 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::RSync do
6
- before do
7
- Backup::Configuration::Storage::RSync.defaults do |rsync|
8
- rsync.username = 'my_username'
9
- rsync.password = 'my_password'
10
- rsync.ip = '123.45.678.90'
11
- rsync.port = 21
12
- rsync.path = 'my_backups'
13
- end
14
- end
15
-
16
- it 'should set the default rsync configuration' do
17
- rsync = Backup::Configuration::Storage::RSync
18
- rsync.username.should == 'my_username'
19
- rsync.password.should == 'my_password'
20
- rsync.ip.should == '123.45.678.90'
21
- rsync.port.should == 21
22
- rsync.path.should == 'my_backups'
23
- end
24
-
25
- describe '#clear_defaults!' do
26
- it 'should clear all the defaults, resetting them to nil' do
27
- Backup::Configuration::Storage::RSync.clear_defaults!
28
-
29
- rsync = Backup::Configuration::Storage::RSync
30
- rsync.username.should == nil
31
- rsync.password.should == nil
32
- rsync.ip.should == nil
33
- rsync.port.should == nil
34
- rsync.path.should == nil
35
- end
36
- end
37
- end
@@ -1,37 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::S3 do
6
- before do
7
- Backup::Configuration::Storage::S3.defaults do |s3|
8
- s3.access_key_id = 'my_access_key_id'
9
- s3.secret_access_key = 'my_secret_access_key'
10
- s3.region = 'us-east-1'
11
- s3.bucket = 'my-bucket'
12
- s3.path = 'my_backups'
13
- end
14
- end
15
-
16
- it 'should set the default S3 configuration' do
17
- s3 = Backup::Configuration::Storage::S3
18
- s3.access_key_id.should == 'my_access_key_id'
19
- s3.secret_access_key.should == 'my_secret_access_key'
20
- s3.region.should == 'us-east-1'
21
- s3.bucket.should == 'my-bucket'
22
- s3.path.should == 'my_backups'
23
- end
24
-
25
- describe '#clear_defaults!' do
26
- it 'should clear all the defaults, resetting them to nil' do
27
- Backup::Configuration::Storage::S3.clear_defaults!
28
-
29
- s3 = Backup::Configuration::Storage::S3
30
- s3.access_key_id.should == nil
31
- s3.secret_access_key.should == nil
32
- s3.region.should == nil
33
- s3.bucket.should == nil
34
- s3.path.should == nil
35
- end
36
- end
37
- end
@@ -1,40 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::SCP do
6
- before do
7
- Backup::Configuration::Storage::SCP.defaults do |scp|
8
- scp.username = 'my_username'
9
- scp.password = 'my_password'
10
- scp.ip = '123.45.678.90'
11
- scp.port = 21
12
- scp.path = 'my_backups'
13
- scp.keep = 20
14
- end
15
- end
16
-
17
- it 'should set the default scp configuration' do
18
- scp = Backup::Configuration::Storage::SCP
19
- scp.username.should == 'my_username'
20
- scp.password.should == 'my_password'
21
- scp.ip.should == '123.45.678.90'
22
- scp.port.should == 21
23
- scp.path.should == 'my_backups'
24
- scp.keep.should == 20
25
- end
26
-
27
- describe '#clear_defaults!' do
28
- it 'should clear all the defaults, resetting them to nil' do
29
- Backup::Configuration::Storage::SCP.clear_defaults!
30
-
31
- scp = Backup::Configuration::Storage::SCP
32
- scp.username.should == nil
33
- scp.password.should == nil
34
- scp.ip.should == nil
35
- scp.port.should == nil
36
- scp.path.should == nil
37
- scp.keep.should == nil
38
- end
39
- end
40
- end
@@ -1,40 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../../spec_helper'
4
-
5
- describe Backup::Configuration::Storage::SFTP do
6
- before do
7
- Backup::Configuration::Storage::SFTP.defaults do |sftp|
8
- sftp.username = 'my_username'
9
- sftp.password = 'my_password'
10
- sftp.ip = '123.45.678.90'
11
- sftp.port = 22
12
- sftp.path = 'my_backups'
13
- sftp.keep = 20
14
- end
15
- end
16
-
17
- it 'should set the default sftp configuration' do
18
- sftp = Backup::Configuration::Storage::SFTP
19
- sftp.username.should == 'my_username'
20
- sftp.password.should == 'my_password'
21
- sftp.ip.should == '123.45.678.90'
22
- sftp.port.should == 22
23
- sftp.path.should == 'my_backups'
24
- sftp.keep.should == 20
25
- end
26
-
27
- describe '#clear_defaults!' do
28
- it 'should clear all the defaults, resetting them to nil' do
29
- Backup::Configuration::Storage::SFTP.clear_defaults!
30
-
31
- sftp = Backup::Configuration::Storage::SFTP
32
- sftp.username.should == nil
33
- sftp.password.should == nil
34
- sftp.ip.should == nil
35
- sftp.port.should == nil
36
- sftp.path.should == nil
37
- sftp.keep.should == nil
38
- end
39
- end
40
- end
@@ -1,30 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.dirname(__FILE__) + '/../spec_helper'
4
-
5
- describe Backup::Database::Base do
6
-
7
- before do
8
- class Backup::Database::Base
9
- def initialize(&block)
10
- instance_eval(&block) if block_given?
11
- end
12
- end
13
- end
14
-
15
- let(:db) do
16
- Backup::Database::Base.new do |db|
17
- db.utility_path = '/var/usr/my_util'
18
- end
19
- end
20
-
21
- it 'should return the utility path instead of auto-detecting it' do
22
- db.utility(:my_database_util).should == '/var/usr/my_util'
23
- end
24
-
25
- it 'should ignore the utility_path when not defined' do
26
- db = Backup::Database::Base.new
27
- db.utility(:my_database_util).should == :my_database_util
28
- end
29
-
30
- end