backup 1.3.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +121 -53
- data/Rakefile +3 -8
- data/VERSION +1 -1
- data/backup.gemspec +20 -34
- data/generators/backup/backup_generator.rb +31 -0
- data/generators/backup/templates/config/backup.rb +60 -0
- data/generators/backup/templates/migrations/create_backup_tables.rb +24 -0
- data/generators/backup/templates/tasks/backup.rake +42 -0
- data/lib/backup.rb +64 -12
- data/lib/backup/adapters/archive.rb +53 -0
- data/lib/backup/adapters/base.rb +65 -0
- data/lib/backup/adapters/mysql.rb +48 -0
- data/lib/backup/configuration/adapter.rb +17 -0
- data/lib/backup/configuration/base.rb +38 -0
- data/lib/backup/configuration/helpers.rb +12 -0
- data/lib/backup/configuration/storage.rb +17 -0
- data/lib/backup/connection/s3.rb +28 -13
- data/lib/backup/record/s3.rb +90 -0
- data/lib/backup/record/scp.rb +92 -0
- data/lib/backup/storage/s3.rb +14 -0
- data/lib/backup/storage/scp.rb +28 -0
- metadata +18 -35
- data/generators/backup_files/backup_files_generator.rb +0 -72
- data/generators/backup_files/templates/backup.sqlite3 +0 -0
- data/generators/backup_files/templates/config.rake +0 -20
- data/generators/backup_files/templates/db.rake +0 -62
- data/generators/backup_files/templates/s3.rake +0 -231
- data/generators/backup_files/templates/s3.yml +0 -120
- data/generators/backup_files/templates/setup.rake +0 -28
- data/generators/backup_files/templates/ssh.rake +0 -226
- data/generators/backup_files/templates/ssh.yml +0 -119
- data/lib/backup/adapter/assets.rb +0 -57
- data/lib/backup/adapter/custom.rb +0 -91
- data/lib/backup/adapter/mysql.rb +0 -65
- data/lib/backup/adapter/sqlite3.rb +0 -49
- data/lib/backup/backup_record/s3.rb +0 -90
- data/lib/backup/backup_record/ssh.rb +0 -90
- data/lib/backup/base.rb +0 -92
- data/lib/backup/connection/base.rb +0 -13
- data/lib/backup/connection/ssh.rb +0 -19
- data/lib/backup/encrypt.rb +0 -18
- data/lib/backup/transfer/base.rb +0 -13
- data/lib/backup/transfer/s3.rb +0 -36
- data/lib/backup/transfer/ssh.rb +0 -30
data/README.rdoc
CHANGED
@@ -1,98 +1,167 @@
|
|
1
1
|
= Backup
|
2
2
|
|
3
|
-
==
|
3
|
+
== 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
|
+
MySQL database (soon PostgreSQL and possibly more) and Archives (any files or folders) to "Amazon S3" or "any remotely accessible server using SCP".
|
7
|
+
Backup handles: Compression, Archiving, Encryption and Backup Cleaning.
|
6
8
|
|
9
|
+
== Backup just updated to version 2.0.0(+)!
|
7
10
|
|
8
|
-
|
11
|
+
This was a major update (read below) and a lot of stuff has changed since version 1.x.x!
|
12
|
+
Notable changes:
|
13
|
+
* Should be a lot more backwards compatible with every update I do.
|
14
|
+
* Does not depend on the separate local SQLite3 file any longer.
|
15
|
+
* Will provide a db migration file for your Rails Application to store backup record data in.
|
16
|
+
* Does not use YAML files to do configuration any longer.
|
17
|
+
* Uses a SINGLE ruby file for "all" configuration (config/backup.rb) using elegant block notations!
|
18
|
+
* Uses a SINGLE rake task to handle the initialization of any backup setting.
|
19
|
+
* Can now configure an unlimited amount of customizable backup settings and run them each "individually"!
|
20
|
+
* HIGHLY IMPROVED USABILITY!
|
9
21
|
|
10
|
-
|
11
|
-
- Any Remote Server You Can Access Through "SSH"
|
22
|
+
== HAVING TROUBLE WITH VERSION "2.0.0"?
|
12
23
|
|
24
|
+
I have encountered and issue with Backup version "2.0.0" after the release. This issue has been addressed and patched to both version 2.0.0 as well as version 2.1.0. This involved the use of the SQLite3 database, which is no longer utilized by Backup. So for people that are going to install Backup version 2.0.0 (or later) right now, this issue no longer applies. However, for users that installed Backup 2.0.0 pretty early after the release, this might cause problems.
|
13
25
|
|
14
|
-
|
26
|
+
==== If you are running Backup version "2.0.0", please run the following to ensure you have a "good" install.
|
27
|
+
|
28
|
+
sudo gem uninstall backup -v 2.0.0
|
29
|
+
sudo gem install backup
|
30
|
+
|
31
|
+
This will obviously uninstall your currently installed backup version 2.0.0 and install the latest version of Backup.
|
32
|
+
Do this and you're set! My apologies for the initial hassle! ;)
|
33
|
+
|
34
|
+
|
35
|
+
=== Refer to the Getting Started page to get up and running incredibly fast with "Backup 2"!
|
36
|
+
http://wiki.github.com/meskyanichi/backup/getting-started
|
15
37
|
|
16
|
-
- SQLite3
|
17
|
-
- MySQL
|
18
|
-
- Assets/Folders (and Sub Folders) of Assets (Think of: Documents, Images, Etc.)
|
19
38
|
|
39
|
+
==== 100% Rewrite!
|
40
|
+
This was a 100% rewrite of the gem. So if you discover any issues with it, please report them here so I can fix them as soon as possible!
|
41
|
+
http://github.com/meskyanichi/backup/issues
|
42
|
+
|
43
|
+
==== Coded Quickly!
|
44
|
+
I've been going all hardcore on this one, building it in a very small amount of time compared to the first version. As far as I can see it fully works,
|
45
|
+
but it is of course likely that you or anyone else might encounter some issues. Please report them if you do.
|
46
|
+
|
47
|
+
==== Updated The Wiki Quickly!
|
48
|
+
So when I finished crafting the Backup Gem, I immediately started working on the Wiki and, as for the gem, updated it very quickly on a late sunday night.
|
49
|
+
I will come back to the Wiki and see if I can improve it even more next weekend when I have more time. I just wanted to get the essentials built in and I think it worked out pretty nicely regardless. If you have any questions though, don't bother asking!
|
20
50
|
|
21
|
-
|
51
|
+
==== More to come!
|
52
|
+
Yes, Backup currently supports the most used backup adapters: MySQL and Archive(Files, Folders).
|
53
|
+
It Archives, Compresses, Encrypts and cleans up old backups if needed.
|
22
54
|
|
23
|
-
|
55
|
+
I do have plans for adding the PostgreSQL and Custom adapter for version 2 as well very soon!
|
56
|
+
If there are requests for more/other adapters, I'm all ears! Enjoy.
|
24
57
|
|
25
|
-
Custom enables you to, regardless whether "Backup" supports your database type or not, to still enable you to make backups and benefit from the other features!
|
26
|
-
There is just one thing you must do yourself inside one of the configuration files that Backup provides, and that is (assuming you know how to create a SQL dump through the command line for your database type), to actually create that command. If you don't how, you can probably find out how when searching through "google". Usually, it takes just "one line" to make a SQL dump, regardless of what database type we're talking about. So now, if you know that particular command to generate that SQL dump for your database, you're practically set to benefit from "Backup"!
|
27
58
|
|
28
|
-
|
29
|
-
|
59
|
+
== (Current) Backup's Capabilities
|
60
|
+
More to be added!
|
30
61
|
|
31
|
-
|
32
|
-
- Backup Compression
|
33
|
-
- Backup Encryption (see below)
|
34
|
-
- Backup Cleaning (see below)
|
35
|
-
- Backup Transfer to S3
|
36
|
-
- Backup Transfer through SSH(SCP) to any remote server
|
62
|
+
=== Storage Methods
|
37
63
|
|
38
|
-
|
64
|
+
- Amazon (S3)
|
65
|
+
- Remote Server (SCP)
|
39
66
|
|
40
|
-
pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}
|
41
67
|
|
42
|
-
|
43
|
-
|
68
|
+
=== Adapters
|
69
|
+
|
70
|
+
- MySQL
|
71
|
+
- Archive (Any physical files/folders)
|
72
|
+
|
73
|
+
(More will be added later, such as PostgreSQL and Custom)
|
44
74
|
|
75
|
+
|
76
|
+
=== Archiving
|
77
|
+
|
78
|
+
==== Backup supports Archiving.
|
79
|
+
When you use the Archive adapter to backup a bunch of files and folders, backup will archive and compress these all together.
|
45
80
|
|
46
81
|
|
47
82
|
=== Encryption
|
48
83
|
|
49
|
-
Backup
|
50
|
-
This is
|
51
|
-
|
52
|
-
encrypt: my_secret_password
|
84
|
+
==== Backup supports a simple form of encryption.
|
85
|
+
This is optional. All adapters support encryption. This is very simple to enable. Just add the following method inside on of your backup settings
|
86
|
+
and it will encrypt it with the specified password:
|
53
87
|
|
54
|
-
|
88
|
+
encrypt_with_password "mypassword"
|
55
89
|
|
56
90
|
|
57
91
|
=== Backup Cleaning
|
58
92
|
|
59
|
-
Backup
|
93
|
+
==== Backup supports backup cleaning.
|
94
|
+
Backup Cleaning (which is optional) enables you to specify the amount of backups that may be stored on either Amazon S3 or a Remote Server. If you for example tell backup to limit the amount of backups by 20, when the 21st backup gets pushed to the storage location, the oldest version will automatically be destroyed.
|
60
95
|
|
61
|
-
|
96
|
+
The idea behind this is to not flood either your backup server, which might resort in possible lack of hard disk space. Another good reason to utilize this would be for Amazon. Although Amazon S3 is extremely cheap, when backing up 1-2GB of MySQL dumps twice a day, it can become quite expensive if you never remove old ones.
|
62
97
|
|
63
|
-
|
98
|
+
To enable this you simply call the following method inside the desired "backup setting":
|
64
99
|
|
100
|
+
keep_backups 20
|
101
|
+
|
102
|
+
|
103
|
+
=== Quick Example of a Single Backup Setting inside the Backup Configuration File
|
65
104
|
|
66
|
-
|
105
|
+
backup 'mysql-backup-s3' do
|
106
|
+
|
107
|
+
adapter :mysql do
|
108
|
+
user 'user'
|
109
|
+
password 'password'
|
110
|
+
database 'database'
|
111
|
+
end
|
112
|
+
|
113
|
+
storage :s3 do
|
114
|
+
access_key_id 'access_key_id'
|
115
|
+
secret_access_key 'secret_access_key'
|
116
|
+
bucket '/bucket/backups/mysql/'
|
117
|
+
end
|
118
|
+
|
119
|
+
keep_backups 25
|
120
|
+
encrypt_with_password 'password'
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
The (backup 'mysql-backup-s3' do) is what I call a "backup setting". The first argument of the block is the so called "trigger".
|
67
125
|
|
68
|
-
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
- I wanted it to support archiving
|
75
|
-
- I wanted it to support encryption
|
76
|
-
- I wanted to be able to store my files on my private backup server and on Amazon S3
|
77
|
-
- I wanted it to be able to automatically remove old backups to keep S3/backup server costs low
|
126
|
+
backup 'mysql-backup-s3' do
|
127
|
+
# Configuration Here
|
128
|
+
end
|
129
|
+
|
130
|
+
This acts as an "identifier" for the "backup setting". The (above) "backup setting" is all pretty straightforward.
|
131
|
+
So now that we've set up a "backup setting", we can run it using a rake task, like so:
|
78
132
|
|
79
|
-
|
133
|
+
rake backup:run trigger="mysql-backup-s3"
|
80
134
|
|
135
|
+
==== That's it, the MySQL database has been "backed up" to Amazon S3. It has been dumped, compressed and encrypted with password.
|
136
|
+
Note: You can add as many "backup setting" blocks as you want inside the "config/backup.rb" configuration file and invoke each of them by their own "trigger". This means you can have as many backup setups as you want, which "don't" all run simultaneously when you initialize a backup.
|
81
137
|
|
82
|
-
|
138
|
+
==== Runs the backup setting with the trigger "backup-logs"
|
139
|
+
rake backup:run trigger="backup-logs"
|
140
|
+
|
141
|
+
==== Runs the backup setting with the trigger "backup-mysql"
|
142
|
+
rake backup:run trigger="backup-mysql"
|
83
143
|
|
84
|
-
|
144
|
+
==== Runs the backup setting with the trigger "backup-assets"
|
145
|
+
rake backup:run trigger="backup-assets"
|
85
146
|
|
86
|
-
|
147
|
+
etc. etc. etc. etc. etc. etc...
|
87
148
|
|
88
|
-
http://wiki.github.com/meskyanichi/backup/installation
|
89
149
|
|
90
150
|
|
151
|
+
== Interested in trying out Backup?
|
152
|
+
|
153
|
+
=== Check out the following Wiki pages to get up and running:
|
154
|
+
|
91
155
|
=== Getting started
|
92
156
|
|
93
157
|
http://wiki.github.com/meskyanichi/backup/getting-started
|
94
158
|
|
95
159
|
|
160
|
+
=== Backup Configuration File (All Adapters, Storage Methods and Options)
|
161
|
+
|
162
|
+
http://wiki.github.com/meskyanichi/backup/configuration-file
|
163
|
+
|
164
|
+
|
96
165
|
=== Rake Tasks
|
97
166
|
|
98
167
|
http://wiki.github.com/meskyanichi/backup/rake-tasks
|
@@ -135,20 +204,19 @@ http://wiki.github.com/meskyanichi/backup/resources
|
|
135
204
|
|
136
205
|
=== Requests
|
137
206
|
|
138
|
-
If anyone
|
207
|
+
If anyone has any requests, please send me a message!
|
139
208
|
|
140
209
|
|
141
210
|
=== Suggestions?
|
142
211
|
|
143
|
-
Send me a message! Fork the project!
|
212
|
+
Send me a message! Fork the project!
|
144
213
|
|
145
214
|
|
146
215
|
=== Found a Bug?
|
147
216
|
|
148
|
-
Report it!
|
149
217
|
http://github.com/meskyanichi/backup/issues
|
150
218
|
|
151
219
|
|
152
220
|
=== Copyright
|
153
221
|
|
154
|
-
Copyright (c) 2009 Michael van Rooijen | Final Creation. See LICENSE for details.
|
222
|
+
Copyright (c) 2009 Michael van Rooijen | Final Creation. (http://final-creation.com/) See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -7,13 +7,9 @@ begin
|
|
7
7
|
gem.name = "backup"
|
8
8
|
gem.summary = %Q{Backup is a gem/plugin that enables you to very easily create backups and transfer these to Amazon S3 or another server with SSH.}
|
9
9
|
gem.description = %Q{
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
a generator script that will place all necessary files inside your Rails application.
|
14
|
-
Two of which, are “yaml” configuration files. Using just these two files to configure a
|
15
|
-
backup for database formats such as a MySQL, SQLite3 or any Assets folder.
|
16
|
-
Setting up “Backup” takes only about a minute or two!
|
10
|
+
Backup is a Ruby Gem, written specifically for Ruby on Rails applications. This gem offers a quick and easy way
|
11
|
+
to configure and run backups of your MySQL database (soon PostgreSQL and possibly more) and Archives (any files or folders)
|
12
|
+
to "Amazon S3" or "any remotely accessible server using SCP". Backup handles: Compression, Archiving, Encryption and Backup Cleaning.
|
17
13
|
}
|
18
14
|
|
19
15
|
gem.email = "meskyan@gmail.com"
|
@@ -22,7 +18,6 @@ begin
|
|
22
18
|
gem.add_dependency "aws-s3", ">= 0.6.2"
|
23
19
|
gem.add_dependency "net-ssh", ">= 2.0.15"
|
24
20
|
gem.add_dependency "net-scp", ">= 1.0.2"
|
25
|
-
gem.add_dependency "sqlite3-ruby", ">= 1.2.5"
|
26
21
|
# gem.files.include 'generators/**/*'
|
27
22
|
# gem.files.include 'lib/**/*'
|
28
23
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/backup.gemspec
CHANGED
@@ -5,19 +5,15 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{backup}
|
8
|
-
s.version = "
|
8
|
+
s.version = "2.0.0"
|
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
|
+
s.date = %q{2009-12-01}
|
13
13
|
s.description = %q{
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
a generator script that will place all necessary files inside your Rails application.
|
18
|
-
Two of which, are “yaml” configuration files. Using just these two files to configure a
|
19
|
-
backup for database formats such as a MySQL, SQLite3 or any Assets folder.
|
20
|
-
Setting up “Backup” takes only about a minute or two!
|
14
|
+
Backup is a Ruby Gem, written specifically for Ruby on Rails applications. This gem offers a quick and easy way
|
15
|
+
to configure and run backups of your MySQL database (soon PostgreSQL and possibly more) and Archives (any files or folders)
|
16
|
+
to "Amazon S3" or "any remotely accessible server using SCP". Backup handles: Compression, Archiving, Encryption and Backup Cleaning.
|
21
17
|
}
|
22
18
|
s.email = %q{meskyan@gmail.com}
|
23
19
|
s.extra_rdoc_files = [
|
@@ -32,30 +28,23 @@ Gem::Specification.new do |s|
|
|
32
28
|
"Rakefile",
|
33
29
|
"VERSION",
|
34
30
|
"backup.gemspec",
|
35
|
-
"generators/
|
36
|
-
"generators/
|
37
|
-
"generators/
|
38
|
-
"generators/
|
39
|
-
"generators/backup_files/templates/s3.rake",
|
40
|
-
"generators/backup_files/templates/s3.yml",
|
41
|
-
"generators/backup_files/templates/setup.rake",
|
42
|
-
"generators/backup_files/templates/ssh.rake",
|
43
|
-
"generators/backup_files/templates/ssh.yml",
|
31
|
+
"generators/backup/backup_generator.rb",
|
32
|
+
"generators/backup/templates/config/backup.rb",
|
33
|
+
"generators/backup/templates/migrations/create_backup_tables.rb",
|
34
|
+
"generators/backup/templates/tasks/backup.rake",
|
44
35
|
"lib/backup.rb",
|
45
|
-
"lib/backup/
|
46
|
-
"lib/backup/
|
47
|
-
"lib/backup/
|
48
|
-
"lib/backup/adapter
|
49
|
-
"lib/backup/
|
50
|
-
"lib/backup/
|
51
|
-
"lib/backup/
|
52
|
-
"lib/backup/connection/base.rb",
|
36
|
+
"lib/backup/adapters/archive.rb",
|
37
|
+
"lib/backup/adapters/base.rb",
|
38
|
+
"lib/backup/adapters/mysql.rb",
|
39
|
+
"lib/backup/configuration/adapter.rb",
|
40
|
+
"lib/backup/configuration/base.rb",
|
41
|
+
"lib/backup/configuration/helpers.rb",
|
42
|
+
"lib/backup/configuration/storage.rb",
|
53
43
|
"lib/backup/connection/s3.rb",
|
54
|
-
"lib/backup/
|
55
|
-
"lib/backup/
|
56
|
-
"lib/backup/
|
57
|
-
"lib/backup/
|
58
|
-
"lib/backup/transfer/ssh.rb"
|
44
|
+
"lib/backup/record/s3.rb",
|
45
|
+
"lib/backup/record/scp.rb",
|
46
|
+
"lib/backup/storage/s3.rb",
|
47
|
+
"lib/backup/storage/scp.rb"
|
59
48
|
]
|
60
49
|
s.homepage = %q{}
|
61
50
|
s.rdoc_options = ["--charset=UTF-8"]
|
@@ -71,18 +60,15 @@ Gem::Specification.new do |s|
|
|
71
60
|
s.add_runtime_dependency(%q<aws-s3>, [">= 0.6.2"])
|
72
61
|
s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.15"])
|
73
62
|
s.add_runtime_dependency(%q<net-scp>, [">= 1.0.2"])
|
74
|
-
s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
|
75
63
|
else
|
76
64
|
s.add_dependency(%q<aws-s3>, [">= 0.6.2"])
|
77
65
|
s.add_dependency(%q<net-ssh>, [">= 2.0.15"])
|
78
66
|
s.add_dependency(%q<net-scp>, [">= 1.0.2"])
|
79
|
-
s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
|
80
67
|
end
|
81
68
|
else
|
82
69
|
s.add_dependency(%q<aws-s3>, [">= 0.6.2"])
|
83
70
|
s.add_dependency(%q<net-ssh>, [">= 2.0.15"])
|
84
71
|
s.add_dependency(%q<net-scp>, [">= 1.0.2"])
|
85
|
-
s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"])
|
86
72
|
end
|
87
73
|
end
|
88
74
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class BackupGenerator < Rails::Generator::Base
|
2
|
+
|
3
|
+
# This method gets initialized when the generator gets run.
|
4
|
+
# It will receive an array of arguments inside @args
|
5
|
+
def initialize(runtime_args, runtime_options = {})
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
# Processes the file generation/templating
|
10
|
+
# This will automatically be run after the initialize method
|
11
|
+
def manifest
|
12
|
+
record do |m|
|
13
|
+
|
14
|
+
# Generates the Rake Tasks and Backup Database
|
15
|
+
m.directory "lib/tasks"
|
16
|
+
m.directory "lib/tasks/backup"
|
17
|
+
m.file "tasks/backup.rake", "lib/tasks/backup/backup.rake"
|
18
|
+
|
19
|
+
# Generates the configuration file
|
20
|
+
m.directory "config"
|
21
|
+
m.file "config/backup.rb", "config/backup.rb"
|
22
|
+
|
23
|
+
# Generates the database migration file
|
24
|
+
m.migration_template "migrations/create_backup_tables.rb",
|
25
|
+
"db/migrate",
|
26
|
+
:migration_file_name => "create_backup_tables"
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
# Backup Configuration File
|
3
|
+
#
|
4
|
+
# Use the "backup" method to add another backup setting to the configuration file.
|
5
|
+
# The argument before the "do" in (backup "argument" do) is called the "trigger".
|
6
|
+
# This acts as the identifier for the configuration.
|
7
|
+
#
|
8
|
+
# In the example below we have a "mysql-backup-s3" trigger for the configuration
|
9
|
+
# inside that block. To initialize the backup process, you invoke it with the following rake task:
|
10
|
+
#
|
11
|
+
# rake backup:run trigger="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
|
+
# For more information on "Backup", please refer to the wiki on github
|
17
|
+
# http://wiki.github.com/meskyanichi/backup/configuration-file
|
18
|
+
|
19
|
+
|
20
|
+
# Initialize with:
|
21
|
+
# rake backup:run trigger='mysql-backup-s3'
|
22
|
+
backup 'mysql-backup-s3' do
|
23
|
+
|
24
|
+
adapter :mysql do
|
25
|
+
user 'user'
|
26
|
+
password 'password'
|
27
|
+
database 'database'
|
28
|
+
end
|
29
|
+
|
30
|
+
storage :s3 do
|
31
|
+
access_key_id 'access_key_id'
|
32
|
+
secret_access_key 'secret_access_key'
|
33
|
+
bucket '/bucket/backups/mysql/'
|
34
|
+
end
|
35
|
+
|
36
|
+
keep_backups 25
|
37
|
+
encrypt_with_password 'password'
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
# Initialize with:
|
43
|
+
# rake backup:run trigger='mysql-backup-s3'
|
44
|
+
backup 'archive-backup-scp' do
|
45
|
+
|
46
|
+
adapter :archive do
|
47
|
+
files ["#{RAILS_ROOT}/log", "#{RAILS_ROOT}/public/assets"]
|
48
|
+
end
|
49
|
+
|
50
|
+
storage :scp do
|
51
|
+
ip 'example.com'
|
52
|
+
user 'user'
|
53
|
+
password 'password'
|
54
|
+
path '/var/backups/archive/'
|
55
|
+
end
|
56
|
+
|
57
|
+
keep_backups :all
|
58
|
+
encrypt_with_password false
|
59
|
+
|
60
|
+
end
|