backup 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +2 -2
- data/README.textile +36 -3
- data/VERSION +1 -1
- data/backup.gemspec +2 -2
- data/generators/backup/templates/config/backup.rb +1 -0
- data/lib/backup/adapters/mysql.rb +3 -3
- data/lib/backup/adapters/postgresql.rb +3 -3
- data/lib/backup/configuration/adapter.rb +1 -1
- data/lib/backup/configuration/storage.rb +1 -1
- data/lib/backup/connection/s3.rb +5 -2
- metadata +2 -2
data/.document
CHANGED
data/README.textile
CHANGED
@@ -4,6 +4,7 @@ h2. A Backup Ruby Gem for Rails
|
|
4
4
|
|
5
5
|
Backup is a Ruby Gem, written specifically for Ruby on Rails applications. This gem offers a quick and easy way to configure and run backups of your
|
6
6
|
MySQL/PostgreSQL databases *(and practically even any other database you can dump through the command line)*. It can also make backups of your *archives* (any files or folders).
|
7
|
+
|
7
8
|
All backups can be transferred to either *"Amazon S3"* or "any remotely accessible server using the *SCP, SFTP or FTP* transfer methods".
|
8
9
|
|
9
10
|
*Backup handles: Compression, Archiving, Encryption and Backup Cleaning.*
|
@@ -47,9 +48,9 @@ What the Custom Adapter does is it allows you to input one or more *commands* to
|
|
47
48
|
*A few bug fixes*
|
48
49
|
|
49
50
|
* Issue where two backup settings would conflict if they were using the same Adapter at the same second! (which can happens when running cronjobs!)
|
50
|
-
* The temporary files will now be nicely name spaced by "trigger" so no conflict
|
51
|
-
* When an exception is raised during the backup process, the temporary files
|
52
|
-
* And some other minor patches
|
51
|
+
* The temporary files will now be nicely name spaced by "trigger" so no conflict between two different triggers can occur
|
52
|
+
* When an exception is raised during the backup process, the temporary files would not be removed. This is now fixed.
|
53
|
+
* And some other minor patches have been applied.
|
53
54
|
|
54
55
|
*Updated the Wiki based on this release.*
|
55
56
|
|
@@ -57,6 +58,10 @@ h3. Get Backup 2.2.x+ now!
|
|
57
58
|
|
58
59
|
bc. sudo gem install backup
|
59
60
|
|
61
|
+
And get up and running with Backup 2.2.x+ by reading the *Getting Started* Wiki Page!
|
62
|
+
|
63
|
+
"http://wiki.github.com/meskyanichi/backup/getting-started":http://wiki.github.com/meskyanichi/backup/getting-started
|
64
|
+
|
60
65
|
|
61
66
|
h2. (Current) Backup's Capabilities
|
62
67
|
|
@@ -116,6 +121,7 @@ bc. backup 'mysql-backup-s3' do
|
|
116
121
|
access_key_id 'access_key_id'
|
117
122
|
secret_access_key 'secret_access_key'
|
118
123
|
bucket '/bucket/backups/mysql/'
|
124
|
+
use_ssl true
|
119
125
|
end
|
120
126
|
keep_backups 25
|
121
127
|
encrypt_with_password 'password'
|
@@ -148,6 +154,21 @@ bc. rake backup:run trigger="backup-mysql"
|
|
148
154
|
|
149
155
|
bc. rake backup:run trigger="backup-assets"
|
150
156
|
|
157
|
+
h3. Additional Options for MySQL and PostgreSQL
|
158
|
+
|
159
|
+
You can pass additional options/flags into the MySQL and PostgreSQL adapters via additional_options. For example:
|
160
|
+
|
161
|
+
bc. backup 'mysql-backup-s3' do
|
162
|
+
adapter :mysql do
|
163
|
+
user 'user'
|
164
|
+
password 'password'
|
165
|
+
database 'database'
|
166
|
+
additional_options '--single-transaction'
|
167
|
+
end
|
168
|
+
.
|
169
|
+
.
|
170
|
+
end
|
171
|
+
|
151
172
|
etc. etc. etc. etc. etc. etc...
|
152
173
|
|
153
174
|
|
@@ -161,6 +182,11 @@ h3. Getting started
|
|
161
182
|
"http://wiki.github.com/meskyanichi/backup/getting-started":http://wiki.github.com/meskyanichi/backup/getting-started
|
162
183
|
|
163
184
|
|
185
|
+
h3. Production Mode (important)
|
186
|
+
|
187
|
+
"http://wiki.github.com/meskyanichi/backup/production-mode":http://wiki.github.com/meskyanichi/backup/production-mode
|
188
|
+
|
189
|
+
|
164
190
|
h3. Backup Configuration File (All Adapters, Storage Methods and Options)
|
165
191
|
|
166
192
|
"http://wiki.github.com/meskyanichi/backup/configuration-file":http://wiki.github.com/meskyanichi/backup/configuration-file
|
@@ -221,6 +247,13 @@ h3. Found a Bug?
|
|
221
247
|
"http://github.com/meskyanichi/backup/issues":http://github.com/meskyanichi/backup/issues
|
222
248
|
|
223
249
|
|
250
|
+
h3. Contributors
|
251
|
+
|
252
|
+
List of people that forked and added stuff!
|
253
|
+
|
254
|
+
* "dtrueman":http://github.com/dtrueman
|
255
|
+
|
256
|
+
|
224
257
|
h3. Copyright
|
225
258
|
|
226
259
|
Copyright (c) 2009 Michael van Rooijen | Final Creation. ("http://final-creation.com":http://final-creation.com) See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.1
|
data/backup.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{backup}
|
8
|
-
s.version = "2.2.
|
8
|
+
s.version = "2.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael van Rooijen"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-06}
|
13
13
|
s.description = %q{
|
14
14
|
Backup is a Ruby Gem, written specifically for Ruby on Rails applications. This gem offers a quick and easy way to configure and run backups of your
|
15
15
|
MySQL/PostgreSQL databases (and practically even any other database you can dump through the command line). It can also make backups of your archives (any files or folders).
|
@@ -2,7 +2,7 @@ module Backup
|
|
2
2
|
module Adapters
|
3
3
|
class MySQL < Backup::Adapters::Base
|
4
4
|
|
5
|
-
attr_accessor :dumped_file, :compressed_file, :encrypted_file, :user, :password, :database, :skip_tables, :host, :port, :socket
|
5
|
+
attr_accessor :dumped_file, :compressed_file, :encrypted_file, :user, :password, :database, :skip_tables, :host, :port, :socket, :additional_options
|
6
6
|
|
7
7
|
# Initializes the Backup Process
|
8
8
|
#
|
@@ -34,7 +34,7 @@ module Backup
|
|
34
34
|
|
35
35
|
# Dumps and Compresses the MySQL file
|
36
36
|
def mysqldump
|
37
|
-
%x{ mysqldump
|
37
|
+
%x{ mysqldump -u #{user} --password='#{password}' #{options} #{additional_options} #{database} #{tables_to_skip} | gzip -f --best > #{File.join(tmp_path, compressed_file)} }
|
38
38
|
end
|
39
39
|
|
40
40
|
# Encrypts the MySQL file
|
@@ -49,7 +49,7 @@ module Backup
|
|
49
49
|
def load_settings
|
50
50
|
self.trigger = procedure.trigger
|
51
51
|
|
52
|
-
%w(user password database skip_tables).each do |attribute|
|
52
|
+
%w(user password database skip_tables additional_options).each do |attribute|
|
53
53
|
send(:"#{attribute}=", procedure.get_adapter_configuration.attributes[attribute])
|
54
54
|
end
|
55
55
|
|
@@ -2,7 +2,7 @@ module Backup
|
|
2
2
|
module Adapters
|
3
3
|
class PostgreSQL < Backup::Adapters::Base
|
4
4
|
|
5
|
-
attr_accessor :dumped_file, :compressed_file, :encrypted_file, :user, :password, :database, :skip_tables, :host, :port, :socket
|
5
|
+
attr_accessor :dumped_file, :compressed_file, :encrypted_file, :user, :password, :database, :skip_tables, :host, :port, :socket, :additional_options
|
6
6
|
|
7
7
|
# Initializes the Backup Process
|
8
8
|
#
|
@@ -34,7 +34,7 @@ module Backup
|
|
34
34
|
|
35
35
|
# Dumps and Compresses the PostgreSQL file
|
36
36
|
def pg_dump
|
37
|
-
%x{ pg_dump
|
37
|
+
%x{ pg_dump -U #{user} #{options} #{additional_options} #{tables_to_skip} #{database} | gzip -f --best > #{File.join(tmp_path, compressed_file)} }
|
38
38
|
end
|
39
39
|
|
40
40
|
# Encrypts the PostgreSQL file
|
@@ -49,7 +49,7 @@ module Backup
|
|
49
49
|
def load_settings
|
50
50
|
self.trigger = procedure.trigger
|
51
51
|
|
52
|
-
%w(user password database skip_tables).each do |attribute|
|
52
|
+
%w(user password database skip_tables additional_options).each do |attribute|
|
53
53
|
send(:"#{attribute}=", procedure.get_adapter_configuration.attributes[attribute])
|
54
54
|
end
|
55
55
|
|
@@ -4,7 +4,7 @@ module Backup
|
|
4
4
|
|
5
5
|
attr_accessor :attributes
|
6
6
|
|
7
|
-
%w(files user password database skip_tables commands).each do |method|
|
7
|
+
%w(files user password database skip_tables commands additional_options).each do |method|
|
8
8
|
define_method method do |value|
|
9
9
|
attributes[method] = value
|
10
10
|
end
|
@@ -3,7 +3,7 @@ module Backup
|
|
3
3
|
class Storage
|
4
4
|
attr_accessor :attributes
|
5
5
|
|
6
|
-
%w(ip user password path access_key_id secret_access_key bucket).each do |method|
|
6
|
+
%w(ip user password path access_key_id secret_access_key use_ssl bucket).each do |method|
|
7
7
|
define_method method do |value|
|
8
8
|
attributes[method] = value
|
9
9
|
end
|
data/lib/backup/connection/s3.rb
CHANGED
@@ -2,7 +2,7 @@ module Backup
|
|
2
2
|
module Connection
|
3
3
|
class S3
|
4
4
|
|
5
|
-
attr_accessor :adapter, :access_key_id, :secret_access_key, :s3_bucket, :final_file, :tmp_path
|
5
|
+
attr_accessor :adapter, :access_key_id, :secret_access_key, :s3_bucket, :use_ssl, :final_file, :tmp_path
|
6
6
|
|
7
7
|
# Initializes the S3 connection, setting the values using the S3 adapter
|
8
8
|
def initialize(adapter = false)
|
@@ -12,6 +12,7 @@ module Backup
|
|
12
12
|
self.access_key_id = adapter.procedure.get_storage_configuration.attributes['access_key_id']
|
13
13
|
self.secret_access_key = adapter.procedure.get_storage_configuration.attributes['secret_access_key']
|
14
14
|
self.s3_bucket = adapter.procedure.get_storage_configuration.attributes['bucket']
|
15
|
+
self.use_ssl = adapter.procedure.get_storage_configuration.attributes['use_ssl']
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
@@ -20,13 +21,15 @@ module Backup
|
|
20
21
|
self.access_key_id = procedure.get_storage_configuration.attributes['access_key_id']
|
21
22
|
self.secret_access_key = procedure.get_storage_configuration.attributes['secret_access_key']
|
22
23
|
self.s3_bucket = procedure.get_storage_configuration.attributes['bucket']
|
24
|
+
self.use_ssl = procedure.get_storage_configuration.attributes['use_ssl']
|
23
25
|
end
|
24
26
|
|
25
27
|
# Establishes a connection with Amazon S3 using the credentials provided by the user
|
26
28
|
def connect
|
27
29
|
AWS::S3::Base.establish_connection!(
|
28
30
|
:access_key_id => access_key_id,
|
29
|
-
:secret_access_key => secret_access_key
|
31
|
+
:secret_access_key => secret_access_key,
|
32
|
+
:use_ssl => use_ssl
|
30
33
|
)
|
31
34
|
end
|
32
35
|
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-06 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|