backup 2.3.3 → 2.3.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,16 @@
1
+ PATCH
2
+ === 2.3.3.1 =====================================
3
+
4
+ Fixes an issue when trying to use S3. It would try to create a bucket
5
+ when one already exists and this raises an error.
6
+
7
+
8
+ UPDATE
9
+ === 2.3.3 =======================================
10
+
11
+ Set final_file to encrypted_file only when encryption is used.
12
+
13
+
1
14
  UPDATE
2
15
  === 2.3.2 =======================================
3
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.3
1
+ 2.3.3.1
@@ -3,40 +3,7 @@ module Backup
3
3
  class MySQL < Backup::Adapters::Base
4
4
 
5
5
  attr_accessor :user, :password, :database, :skip_tables, :host, :port, :socket, :additional_options, :tables
6
-
7
- # the adapter declares his own configuration
8
- adapter_configuration do
9
- # :required => true # by default, optional
10
- string :user, :password, :database, :additional_options
11
- # array allows to call the same configuration multiple times:
12
- # skip_tables 't1', 't2'
13
- # skip_tables 't3'
14
- # the result will always combined
15
- array :skip_tables
16
- configuration_group :options do
17
- string :host, :port, :socket
18
- end
19
- # settings to be applied globally
20
- global do
21
- string :mysqldump_full_path
22
- end
23
- end
24
-
25
- # adapter :mysql do
26
- # user 'user'
27
- # password 'password'
28
- # database 'database'
29
- #
30
- # # skip_tables ['table1', 'table2', 'table3']
31
- # #
32
- # # options do
33
- # # host '123.45.678.90'
34
- # # port '80'
35
- # # socket '/tmp/socket.sock'
36
- # # end
37
- # # additional_options '--single-transaction --quick'
38
- # end
39
-
6
+
40
7
  private
41
8
 
42
9
  # Dumps and Compresses the MySQL file
@@ -2,11 +2,6 @@ module Backup
2
2
  module Configuration
3
3
  module Helpers
4
4
 
5
- def global_settings(&block)
6
- @global_settings = Backup::Configuration::GlobalSettings.new
7
- @global_settings.instance_eval &block
8
- end
9
-
10
5
  # A helper method for the config/backup.rb configuration file
11
6
  # Expects a trigger in argument one (STRING)
12
7
  # Expects a block of settings
@@ -26,4 +21,4 @@ module Backup
26
21
 
27
22
  end
28
23
  end
29
- end
24
+ end
@@ -37,8 +37,14 @@ module Backup
37
37
 
38
38
  # Wrapper for the Bucket object
39
39
  def bucket
40
- bucket = service.buckets.build(s3_bucket)
41
- bucket.save
40
+ begin
41
+ # Find existing bucket:
42
+ bucket = service.buckets.find(s3_bucket)
43
+ rescue ::S3::Error::NoSuchBucket => e
44
+ # Apparently the bucket doesn't exist yet, so create a new one:
45
+ bucket = service.buckets.build(s3_bucket)
46
+ bucket.save
47
+ end
42
48
  bucket.retrieve
43
49
  end
44
50
 
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 121
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
9
  - 3
10
- version: 2.3.3
10
+ - 1
11
+ version: 2.3.3.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Michael van Rooijen
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-09-20 00:00:00 -03:00
19
+ date: 2010-09-21 00:00:00 +02:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -179,52 +180,50 @@ files:
179
180
  - CHANGELOG
180
181
  - LICENSE
181
182
  - VERSION
182
- - lib/backup/esboco.txt
183
- - lib/backup/environment/base.rb
184
- - lib/backup/environment/unix.rb
185
- - lib/backup/environment/rails.rb
186
- - lib/backup/command_helper.rb
187
- - lib/backup/connection/cloudfiles.rb
188
- - lib/backup/connection/s3.rb
183
+ - lib/backup/adapters/archive.rb
184
+ - lib/backup/adapters/base.rb
189
185
  - lib/backup/adapters/custom.rb
190
- - lib/backup/adapters/postgresql.rb
191
186
  - lib/backup/adapters/mysql.rb
187
+ - lib/backup/adapters/postgresql.rb
192
188
  - lib/backup/adapters/sqlite.rb
193
- - lib/backup/adapters/base.rb
194
- - lib/backup/adapters/archive.rb
195
- - lib/backup/storage/cloudfiles.rb
196
- - lib/backup/storage/sftp.rb
197
- - lib/backup/storage/s3.rb
198
- - lib/backup/storage/local.rb
199
- - lib/backup/storage/base.rb
200
- - lib/backup/storage/scp.rb
201
- - lib/backup/storage/ftp.rb
189
+ - lib/backup/command_helper.rb
190
+ - lib/backup/configuration/adapter.rb
191
+ - lib/backup/configuration/adapter_options.rb
192
+ - lib/backup/configuration/attributes.rb
193
+ - lib/backup/configuration/base.rb
194
+ - lib/backup/configuration/helpers.rb
195
+ - lib/backup/configuration/mail.rb
196
+ - lib/backup/configuration/smtp.rb
197
+ - lib/backup/configuration/storage.rb
198
+ - lib/backup/connection/cloudfiles.rb
199
+ - lib/backup/connection/s3.rb
200
+ - lib/backup/environment/base.rb
201
+ - lib/backup/environment/rails.rb
202
+ - lib/backup/environment/unix.rb
202
203
  - lib/backup/mail/base.rb
203
204
  - lib/backup/mail/mail.txt
205
+ - lib/backup/record/base.rb
204
206
  - lib/backup/record/cloudfiles.rb
205
- - lib/backup/record/sftp.rb
206
- - lib/backup/record/s3.rb
207
+ - lib/backup/record/ftp.rb
207
208
  - lib/backup/record/local.rb
208
- - lib/backup/record/base.rb
209
+ - lib/backup/record/s3.rb
209
210
  - lib/backup/record/scp.rb
210
- - lib/backup/record/ftp.rb
211
- - lib/backup/configuration/attributes.rb
212
- - lib/backup/configuration/mail.rb
213
- - lib/backup/configuration/smtp.rb
214
- - lib/backup/configuration/helpers.rb
215
- - lib/backup/configuration/base.rb
216
- - lib/backup/configuration/storage.rb
217
- - lib/backup/configuration/adapter.rb
218
- - lib/backup/configuration/global_settings.rb
219
- - lib/backup/configuration/adapter_options.rb
211
+ - lib/backup/record/sftp.rb
212
+ - lib/backup/storage/base.rb
213
+ - lib/backup/storage/cloudfiles.rb
214
+ - lib/backup/storage/ftp.rb
215
+ - lib/backup/storage/local.rb
216
+ - lib/backup/storage/s3.rb
217
+ - lib/backup/storage/scp.rb
218
+ - lib/backup/storage/sftp.rb
220
219
  - lib/backup.rb
221
220
  - bin/backup
222
- - generators/backup_update/templates/migrations/update_backup_tables.rb
223
- - generators/backup_update/backup_update_generator.rb
224
- - generators/backup/templates/migrations/create_backup_tables.rb
221
+ - generators/backup/backup_generator.rb
225
222
  - generators/backup/templates/config/backup.rb
223
+ - generators/backup/templates/migrations/create_backup_tables.rb
226
224
  - generators/backup/templates/tasks/backup.rake
227
- - generators/backup/backup_generator.rb
225
+ - generators/backup_update/backup_update_generator.rb
226
+ - generators/backup_update/templates/migrations/update_backup_tables.rb
228
227
  - setup/backup.rb
229
228
  - setup/backup.sqlite3
230
229
  has_rdoc: true
@@ -1,8 +0,0 @@
1
- module Backup
2
- module Configuration
3
- class GlobalSettings
4
- extend Backup::Configuration::Attributes
5
- generate_attributes %w(pg_dump_full_path mysqldump_full_path)
6
- end
7
- end
8
- end
@@ -1,43 +0,0 @@
1
- # TODO como usar pipes para melhorar performance?
2
-
3
- BackupManager(params)
4
- Adapter.new(params).perform_backup # stores in tmp_path/filename
5
- Compressor.execute # stores in tmp_path/filename.gz or bz2
6
- Encryptor.execute # stores in tmp_path/filename.enc
7
- Splitter.execute # stores in tmp_path/filename.enc*
8
- # TODO store the "results" of the backup
9
- Storage.store # tmp_path/filename
10
- Notifier.notify
11
-
12
-
13
- RestoreManager
14
- # TODO store the "results" of the backup
15
- RETRIEVE em vez de get!
16
- Storage.get # gets the file and stores in tmp_path/filename*
17
- Splitter.undo # stores in tmp_path/filename.enc*
18
- Encryptor.undo # stores in tmp_path/filename.enc
19
- Compressor.undo # stores in tmp_path/filename.gz or bz2
20
- Adapter.perform_restore # stores in tmp_path/filename
21
-
22
- class Base
23
- global_configuration do
24
- string :bin_full_path
25
- end
26
-
27
- configuration do
28
- string :username, :required => true
29
- end
30
-
31
- def initialize
32
- # handle your options
33
- end
34
-
35
- def perform_backup # or backup_command?? if we use a command, the manager can decide to add the filename or pipe to the next command
36
- # do your backup here, and store it in tmp_path/filename
37
- end
38
-
39
- def perform_restore # or restore_command?? so we can pipe the commands
40
- # do your restore here from tmp_path/filename
41
- end
42
- end
43
-