namxam-backup 2.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/CHANGELOG +131 -0
  2. data/LICENSE +20 -0
  3. data/README.md +122 -0
  4. data/bin/backup +108 -0
  5. data/generators/backup/backup_generator.rb +69 -0
  6. data/generators/backup/templates/backup.rake +56 -0
  7. data/generators/backup/templates/backup.rb +253 -0
  8. data/generators/backup/templates/create_backup_tables.rb +18 -0
  9. data/generators/backup_update/backup_update_generator.rb +50 -0
  10. data/generators/backup_update/templates/migrations/update_backup_tables.rb +27 -0
  11. data/lib/backup.rb +132 -0
  12. data/lib/backup/adapters/archive.rb +34 -0
  13. data/lib/backup/adapters/base.rb +167 -0
  14. data/lib/backup/adapters/custom.rb +41 -0
  15. data/lib/backup/adapters/mongo_db.rb +139 -0
  16. data/lib/backup/adapters/mysql.rb +60 -0
  17. data/lib/backup/adapters/postgresql.rb +56 -0
  18. data/lib/backup/adapters/sqlite.rb +25 -0
  19. data/lib/backup/command_helper.rb +14 -0
  20. data/lib/backup/configuration/adapter.rb +21 -0
  21. data/lib/backup/configuration/adapter_options.rb +8 -0
  22. data/lib/backup/configuration/attributes.rb +19 -0
  23. data/lib/backup/configuration/base.rb +75 -0
  24. data/lib/backup/configuration/helpers.rb +24 -0
  25. data/lib/backup/configuration/mail.rb +20 -0
  26. data/lib/backup/configuration/smtp.rb +8 -0
  27. data/lib/backup/configuration/storage.rb +8 -0
  28. data/lib/backup/connection/cloudfiles.rb +75 -0
  29. data/lib/backup/connection/dropbox.rb +62 -0
  30. data/lib/backup/connection/s3.rb +88 -0
  31. data/lib/backup/core_ext/object.rb +5 -0
  32. data/lib/backup/environment/base.rb +12 -0
  33. data/lib/backup/environment/rails_configuration.rb +15 -0
  34. data/lib/backup/environment/unix_configuration.rb +109 -0
  35. data/lib/backup/mail/base.rb +97 -0
  36. data/lib/backup/mail/mail.txt +7 -0
  37. data/lib/backup/record/base.rb +65 -0
  38. data/lib/backup/record/cloudfiles.rb +28 -0
  39. data/lib/backup/record/dropbox.rb +27 -0
  40. data/lib/backup/record/ftp.rb +39 -0
  41. data/lib/backup/record/local.rb +26 -0
  42. data/lib/backup/record/s3.rb +25 -0
  43. data/lib/backup/record/scp.rb +33 -0
  44. data/lib/backup/record/sftp.rb +38 -0
  45. data/lib/backup/storage/base.rb +10 -0
  46. data/lib/backup/storage/cloudfiles.rb +16 -0
  47. data/lib/backup/storage/dropbox.rb +12 -0
  48. data/lib/backup/storage/ftp.rb +38 -0
  49. data/lib/backup/storage/local.rb +22 -0
  50. data/lib/backup/storage/s3.rb +15 -0
  51. data/lib/backup/storage/scp.rb +30 -0
  52. data/lib/backup/storage/sftp.rb +31 -0
  53. data/lib/backup/version.rb +3 -0
  54. data/lib/generators/backup/USAGE +10 -0
  55. data/lib/generators/backup/backup_generator.rb +47 -0
  56. data/lib/generators/backup/templates/backup.rake +56 -0
  57. data/lib/generators/backup/templates/backup.rb +236 -0
  58. data/lib/generators/backup/templates/create_backup_tables.rb +18 -0
  59. data/setup/backup.rb +255 -0
  60. data/setup/backup.sqlite3 +0 -0
  61. metadata +278 -0
@@ -0,0 +1,18 @@
1
+ class CreateBackupTables < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :backup do |t|
4
+ t.string :trigger
5
+ t.string :adapter
6
+ t.string :filename
7
+ t.string :md5sum
8
+ t.string :path
9
+ t.string :bucket
10
+ t.string :type
11
+ t.timestamps
12
+ end
13
+ end
14
+
15
+ def self.down
16
+ drop_table :backup
17
+ end
18
+ end
@@ -0,0 +1,255 @@
1
+ # Backup Configuration File
2
+ #
3
+ # Use the "backup" block to add backup settings to the configuration file.
4
+ # The argument before the "do" in (backup "argument" do) is called a "trigger".
5
+ # This acts as the identifier for the configuration.
6
+ #
7
+ # In the example below we have a "mysql-backup-s3" trigger for the backup setting.
8
+ # All the configuration is done inside this block. To initialize the backup process for this block,
9
+ # you invoke it using the following command:
10
+ #
11
+ # backup --run mysql-backup-s3
12
+ #
13
+ # You can add as many backup block settings as you want, just be sure every trigger is unique and you can run
14
+ # each of them separately.
15
+ #
16
+ # ADAPTERS
17
+ # - MySQL
18
+ # - PostgreSQL
19
+ # - SQLite
20
+ # - Archive
21
+ # - Custom
22
+ #
23
+ # STORAGE METHODS
24
+ # - S3 (Amazon)
25
+ # - CF (Rackspace Cloud Files)
26
+ # - Dropbox (Dropbox Web Service)
27
+ # - SCP (Remote Server)
28
+ # - FTP (Remote Server)
29
+ # - SFTP (Remote Server)
30
+ # - LOCAL (Local Server)
31
+ #
32
+ # GLOBAL OPTIONS
33
+ # - Keep Backups (keep_backups)
34
+ # - Encrypt With Pasword (encrypt_with_password)
35
+ # - Encrypt With GPG Public Key (encrypt_with_gpg_public_key)
36
+ # - Notify (notify)
37
+ #
38
+ # This is the "decrypt" command for all encrypted backups:
39
+ # sudo backup --decrypt /path/to/encrypted/file
40
+ #
41
+ # Each Backup Setting can contain:
42
+ # - 1 Adapter
43
+ # - 1 Storage Method
44
+ # - Multiple Global Options
45
+ #
46
+ # The combination of these, however, do not matter! So experiment with it.
47
+ #
48
+ # You can also let Backup notify you by email on successfully created backups.
49
+ # - Just uncomment the block of code below (notifier_settings) and fill in your credentials.
50
+ # - Then for set "notify" to "true" in each (backup) block you wish to be notified of.
51
+ #
52
+ # For more information on "Backup", please refer to the wiki on github
53
+ # http://wiki.github.com/meskyanichi/backup/configuration-file
54
+
55
+
56
+ # Notifier
57
+ # Uncomment this if you want to enable notification by email on successful backup runs
58
+ # You will also have to set "notify true" inside each backup block below to enable it for that particular backup
59
+ # notifier_settings do
60
+ #
61
+ # to "example1@gmail.com"
62
+ # from "example2@gmail.com"
63
+ #
64
+ # smtp do
65
+ # host "smtp.gmail.com"
66
+ # port "587"
67
+ # username "example1@gmail.com"
68
+ # password "example1password"
69
+ # authentication "plain"
70
+ # domain "localhost.localdomain"
71
+ # tls true
72
+ # end
73
+ #
74
+ # end
75
+
76
+
77
+ # Initialize with:
78
+ # sudo backup --run mysql-backup-s3
79
+ backup 'mysql-backup-s3' do
80
+
81
+ adapter :mysql do
82
+ user 'user'
83
+ password 'password'
84
+ database 'database'
85
+
86
+ # skip_tables ['table1', 'table2', 'table3']
87
+ #
88
+ # options do
89
+ # host '123.45.678.90'
90
+ # port '80'
91
+ # socket '/tmp/socket.sock'
92
+ # end
93
+ # additional_options '--single-transaction --quick'
94
+ end
95
+
96
+ storage :s3 do
97
+ access_key_id 'access_key_id'
98
+ secret_access_key 'secret_access_key'
99
+ bucket '/bucket/backups/mysql/'
100
+ use_ssl true
101
+ end
102
+
103
+ keep_backups 25
104
+ encrypt_with_password 'password'
105
+ notify false
106
+
107
+ end
108
+
109
+
110
+ # Initialize with:
111
+ # sudo backup --run mysql-backup-cloudfiles
112
+ backup 'mysql-backup-cloudfiles' do
113
+
114
+ adapter :mysql do
115
+ user 'user'
116
+ password 'password'
117
+ database 'database'
118
+ end
119
+
120
+ storage :cloudfiles do
121
+ username 'username'
122
+ api_key 'api_key'
123
+ container 'mysql_backup'
124
+ end
125
+
126
+ encrypt_with_gpg_public_key <<-KEY
127
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
128
+ Version: GnuPG v1.4.7 (Darwin)
129
+
130
+ Your very long public key goes here
131
+ -----END PGP PUBLIC KEY BLOCK-----
132
+ KEY
133
+
134
+ end
135
+
136
+
137
+ # Initialize with:
138
+ # sudo backup --run postgresql-backup-s3
139
+ backup 'postgresql-backup-scp' do
140
+
141
+ adapter :postgresql do
142
+ user 'user'
143
+ database 'database'
144
+
145
+ # skip_tables ['table1', 'table2', 'table3']
146
+
147
+ # options do
148
+ # host '123.45.678.90'
149
+ # port '80'
150
+ # socket '/tmp/socket.sock'
151
+ # end
152
+ # additional_options '--clean --blobs'
153
+ end
154
+
155
+ storage :scp do
156
+ ip 'example.com'
157
+ user 'user'
158
+ password 'password'
159
+ path '/var/backups/postgresql/'
160
+ end
161
+
162
+ keep_backups :all
163
+ encrypt_with_password false
164
+ notify false
165
+
166
+ end
167
+
168
+
169
+ # Initialize with:
170
+ # sudo backup --run archive-backup-ftp
171
+ backup 'archive-backup-ftp' do
172
+
173
+ adapter :archive do
174
+ files ["/path/to/log", "/path/to/db"]
175
+ end
176
+
177
+ storage :ftp do
178
+ ip 'example.com'
179
+ user 'user'
180
+ password 'password'
181
+ path '/var/backups/archive/'
182
+ end
183
+
184
+ keep_backups 10
185
+ encrypt_with_password false
186
+ notify false
187
+
188
+ end
189
+
190
+
191
+ # Initialize with:
192
+ # sudo backup --run custom-backup-sftp
193
+ backup 'custom-backup-sftp' do
194
+
195
+ adapter :custom do
196
+ commands \
197
+ [ "mysqldump [options] [database] > :tmp_path/my_mysql_dump.sql",
198
+ "pg_dump [options] [database] > :tmp_path/my_postgresql_dump.sql",
199
+ "any_other_db_format [options] [database] > :tmp_path/my_any_other_db_format.sql" ]
200
+ end
201
+
202
+ storage :sftp do
203
+ ip 'example.com'
204
+ user 'user'
205
+ password 'password'
206
+ path '/var/backups/custom/'
207
+ end
208
+
209
+ keep_backups :all
210
+ encrypt_with_password 'password'
211
+ notify false
212
+
213
+ end
214
+
215
+
216
+ # Initializ with:
217
+ # sudo backup --run sqlite-backup-local
218
+ backup 'sqlite-backup-local' do
219
+
220
+ adapter :sqlite do
221
+ database "/path/to/database.sqlite3"
222
+ end
223
+
224
+ storage :local do
225
+ path "/path/to/storage/location/"
226
+ end
227
+
228
+ keep_backups :all
229
+ encrypt_with_password false
230
+ notify false
231
+
232
+ end
233
+
234
+
235
+ # Initialize with
236
+ # sudo backup --run postgresql-backup-dropbox
237
+ backup 'postgresql-backup-dropbox' do
238
+
239
+ adapter :postgresql do
240
+ user 'devmen'
241
+ database 'domowoi_test'
242
+ end
243
+
244
+ storage :dropbox do
245
+ api_key 'your_api_key'
246
+ secret_access_key 'your_api_secret'
247
+ username 'user@example.org'
248
+ password 'super_s3cret'
249
+ path 'backups'
250
+ end
251
+
252
+ keep_backups :all
253
+ encrypt_with_password false
254
+ notify false
255
+ end
Binary file
metadata ADDED
@@ -0,0 +1,278 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: namxam-backup
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 4
8
+ - 5
9
+ version: 2.4.5
10
+ platform: ruby
11
+ authors:
12
+ - Michael van Rooijen
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-12 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: json_pure
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 4
30
+ - 6
31
+ version: 1.4.6
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: net-ssh
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 2
43
+ - 0
44
+ - 15
45
+ version: 2.0.15
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: net-scp
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 1
57
+ - 0
58
+ - 2
59
+ version: 1.0.2
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: net-sftp
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 2
71
+ - 0
72
+ - 4
73
+ version: 2.0.4
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: activerecord
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ segments:
84
+ - 2
85
+ - 3
86
+ - 5
87
+ version: 2.3.5
88
+ type: :runtime
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: sqlite3-ruby
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ segments:
98
+ - 1
99
+ - 2
100
+ - 5
101
+ version: 1.2.5
102
+ type: :runtime
103
+ version_requirements: *id006
104
+ - !ruby/object:Gem::Dependency
105
+ name: hirb
106
+ prerelease: false
107
+ requirement: &id007 !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ segments:
112
+ - 0
113
+ - 2
114
+ - 9
115
+ version: 0.2.9
116
+ type: :runtime
117
+ version_requirements: *id007
118
+ - !ruby/object:Gem::Dependency
119
+ name: pony
120
+ prerelease: false
121
+ requirement: &id008 !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ segments:
126
+ - 0
127
+ - 5
128
+ version: "0.5"
129
+ type: :runtime
130
+ version_requirements: *id008
131
+ - !ruby/object:Gem::Dependency
132
+ name: cloudfiles
133
+ prerelease: false
134
+ requirement: &id009 !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ segments:
139
+ - 1
140
+ - 4
141
+ - 7
142
+ version: 1.4.7
143
+ type: :runtime
144
+ version_requirements: *id009
145
+ - !ruby/object:Gem::Dependency
146
+ name: dropbox
147
+ prerelease: false
148
+ requirement: &id010 !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ segments:
153
+ - 1
154
+ - 1
155
+ - 2
156
+ version: 1.1.2
157
+ type: :runtime
158
+ version_requirements: *id010
159
+ - !ruby/object:Gem::Dependency
160
+ name: fog
161
+ prerelease: false
162
+ requirement: &id011 !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ segments:
167
+ - 0
168
+ - 3
169
+ - 5
170
+ version: 0.3.5
171
+ type: :runtime
172
+ version_requirements: *id011
173
+ description: |-
174
+ Backup is a Ruby Gem written for Unix and Ruby on Rails (2 and 3) environments. It can be used both with
175
+ and without the Ruby on Rails framework! This gem offers a quick and simple solution to backing up databases
176
+ such as MySQL/PostgreSQL/SQLite and Files/Folders. All backups can be transferred to Amazon S3, Rackspace Cloud Files,
177
+ Dropbox Web Service, any remote server you have access to (using either SCP, SFTP or regular FTP), or a Local server.
178
+ Backup handles Compression, Archiving, Encryption (OpenSSL or GPG), Backup Cleaning (Cycling) and supports Email Notifications.
179
+ email: meskyanichi@gmail.com
180
+ executables:
181
+ - backup
182
+ extensions: []
183
+
184
+ extra_rdoc_files: []
185
+
186
+ files:
187
+ - README.md
188
+ - CHANGELOG
189
+ - LICENSE
190
+ - lib/backup/adapters/archive.rb
191
+ - lib/backup/adapters/base.rb
192
+ - lib/backup/adapters/custom.rb
193
+ - lib/backup/adapters/mongo_db.rb
194
+ - lib/backup/adapters/mysql.rb
195
+ - lib/backup/adapters/postgresql.rb
196
+ - lib/backup/adapters/sqlite.rb
197
+ - lib/backup/command_helper.rb
198
+ - lib/backup/configuration/adapter.rb
199
+ - lib/backup/configuration/adapter_options.rb
200
+ - lib/backup/configuration/attributes.rb
201
+ - lib/backup/configuration/base.rb
202
+ - lib/backup/configuration/helpers.rb
203
+ - lib/backup/configuration/mail.rb
204
+ - lib/backup/configuration/smtp.rb
205
+ - lib/backup/configuration/storage.rb
206
+ - lib/backup/connection/cloudfiles.rb
207
+ - lib/backup/connection/dropbox.rb
208
+ - lib/backup/connection/s3.rb
209
+ - lib/backup/core_ext/object.rb
210
+ - lib/backup/environment/base.rb
211
+ - lib/backup/environment/rails_configuration.rb
212
+ - lib/backup/environment/unix_configuration.rb
213
+ - lib/backup/mail/base.rb
214
+ - lib/backup/mail/mail.txt
215
+ - lib/backup/record/base.rb
216
+ - lib/backup/record/cloudfiles.rb
217
+ - lib/backup/record/dropbox.rb
218
+ - lib/backup/record/ftp.rb
219
+ - lib/backup/record/local.rb
220
+ - lib/backup/record/s3.rb
221
+ - lib/backup/record/scp.rb
222
+ - lib/backup/record/sftp.rb
223
+ - lib/backup/storage/base.rb
224
+ - lib/backup/storage/cloudfiles.rb
225
+ - lib/backup/storage/dropbox.rb
226
+ - lib/backup/storage/ftp.rb
227
+ - lib/backup/storage/local.rb
228
+ - lib/backup/storage/s3.rb
229
+ - lib/backup/storage/scp.rb
230
+ - lib/backup/storage/sftp.rb
231
+ - lib/backup/version.rb
232
+ - lib/backup.rb
233
+ - lib/generators/backup/backup_generator.rb
234
+ - lib/generators/backup/templates/backup.rake
235
+ - lib/generators/backup/templates/backup.rb
236
+ - lib/generators/backup/templates/create_backup_tables.rb
237
+ - lib/generators/backup/USAGE
238
+ - bin/backup
239
+ - generators/backup/backup_generator.rb
240
+ - generators/backup/templates/backup.rake
241
+ - generators/backup/templates/backup.rb
242
+ - generators/backup/templates/create_backup_tables.rb
243
+ - generators/backup_update/backup_update_generator.rb
244
+ - generators/backup_update/templates/migrations/update_backup_tables.rb
245
+ - setup/backup.rb
246
+ - setup/backup.sqlite3
247
+ has_rdoc: true
248
+ homepage: http://github.com/meskyanichi/backup
249
+ licenses: []
250
+
251
+ post_install_message:
252
+ rdoc_options: []
253
+
254
+ require_paths:
255
+ - lib
256
+ required_ruby_version: !ruby/object:Gem::Requirement
257
+ requirements:
258
+ - - ">="
259
+ - !ruby/object:Gem::Version
260
+ segments:
261
+ - 0
262
+ version: "0"
263
+ required_rubygems_version: !ruby/object:Gem::Requirement
264
+ requirements:
265
+ - - ">="
266
+ - !ruby/object:Gem::Version
267
+ segments:
268
+ - 0
269
+ version: "0"
270
+ requirements: []
271
+
272
+ rubyforge_project:
273
+ rubygems_version: 1.3.6
274
+ signing_key:
275
+ specification_version: 3
276
+ summary: Backup is a Ruby Gem that simplifies making backups for databases, files and folders.
277
+ test_files: []
278
+