sqlup 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +12 -11
- data/bin/sqlup +9 -1
- data/lib/mysql_backup.rb +1 -1
- metadata +2 -2
data/README.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
1
|
+
sqlup
|
2
2
|
by James Moore
|
3
|
+
http://sqlup.restphone.com
|
3
4
|
|
4
5
|
== DESCRIPTION:
|
5
6
|
|
@@ -34,7 +35,7 @@ Retrieve the backup files (where full:type_mysqldump:log_file_domU-12-31-35-00-3
|
|
34
35
|
=== Usage
|
35
36
|
|
36
37
|
Get help:
|
37
|
-
sqlup
|
38
|
+
sqlup -h
|
38
39
|
Back up the data files:
|
39
40
|
sqlup binary -bucket sqlup
|
40
41
|
Back up a mysqldump run:
|
@@ -58,8 +59,8 @@ You need to specify your access codes using the AWS::S3 environment variables:
|
|
58
59
|
export AMAZON_SECRET_ACCESS_KEY='xxxxxxxxxx'
|
59
60
|
|
60
61
|
|
61
|
-
It
|
62
|
-
with backups sent to Amazon
|
62
|
+
It's primarily targeted at MySQL servers running on Amazon's EC2 virtual server system,
|
63
|
+
with backups sent to Amazon's S3 storage service.
|
63
64
|
|
64
65
|
=== What it backs up
|
65
66
|
There are three parts to a MySQL backup system:
|
@@ -68,22 +69,22 @@ There are three parts to a MySQL backup system:
|
|
68
69
|
2. Full dumps using the mysqldump tool.
|
69
70
|
3. The binary log files.
|
70
71
|
|
71
|
-
Normally, you
|
72
|
-
Backups are tarred, gzip
|
72
|
+
Normally, you'd make a full copy of your system using either #1 or #2, and then have sqlup make backups of the binary logs to S3 every N seconds.
|
73
|
+
Backups are tarred, gzip'ed, and split to fit into S3 buckets.
|
73
74
|
|
74
75
|
=== FAQs
|
75
76
|
|
76
77
|
* Why would I want to make copies of the data files instead of using mysqldump?
|
77
78
|
|
78
|
-
Speed. Recovering mysqldump files can take a while; recovering when you have copies of the data files is much faster. If you
|
79
|
+
Speed. Recovering mysqldump files can take a while; recovering when you have copies of the data files is much faster. If you've got a small database, though, just use mysqldump. You can test this yourself; just do a mysqldump of your current database, and run it against a MySQL server on another machine. If that's fast enough for you, you don't need to worry about the binary files.
|
79
80
|
|
80
|
-
* Can I use the database while it
|
81
|
+
* Can I use the database while it's being backed up?
|
81
82
|
|
82
|
-
Yes, sort of. The binary backup is going to lock every table in the system until it
|
83
|
+
Yes, sort of. The binary backup is going to lock every table in the system until it's finished making a tarball of all the data files. (A future enhancement will be to use a versioning file system.) As long as no one writes to the database, reads will continue. However, as soon as someone wants to write to a table, it's very likely that all future readers will be blocked until the backup is finished writing temporary files to disk.
|
83
84
|
|
84
85
|
* Is there an automated recovery system?
|
85
86
|
|
86
|
-
Not yet. There
|
87
|
+
Not yet. There's a command to get the backups back from S3, but you need to go through the standard mysql recovery process by hand once you have the files.
|
87
88
|
|
88
89
|
|
89
90
|
== FEATURES/PROBLEMS:
|
@@ -119,4 +120,4 @@ GNU General Public License for more details.
|
|
119
120
|
|
120
121
|
You should have received a copy of the GNU General Public License
|
121
122
|
along with this program; if not, write to the Free Software
|
122
|
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
123
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
data/bin/sqlup
CHANGED
@@ -15,7 +15,8 @@ module Example extend OptiFlagSet
|
|
15
15
|
keyword 'get', :description => 'Get a binary or a mysqldump backup. Requires --name'
|
16
16
|
keyword 'get_logs', :description => "Get all the current and complete logs"
|
17
17
|
keyword 'rm', :description => 'Remove a backup (use -name to specify which backup to remove)'
|
18
|
-
|
18
|
+
keyword 'help'
|
19
|
+
optional_flag 'bucket', :description => "The name of the S3 bucket"
|
19
20
|
optional_flag 'backup_type', :description => "(ls) The kind of backup"
|
20
21
|
optional_flag 'skip_most_recent', :description => "(ls) Do not display the most recent N logs. Usually used to get a list of obsolete current logs."
|
21
22
|
optional_flag 'name', :description => '(get, rm) The name of the backup to process'
|
@@ -30,6 +31,13 @@ end
|
|
30
31
|
|
31
32
|
flags = ARGV.flags
|
32
33
|
|
34
|
+
if flags.help?
|
35
|
+
puts File.readlines(File.dirname(__FILE__) + '/../README.txt')
|
36
|
+
exit 0
|
37
|
+
end
|
38
|
+
|
39
|
+
puts "Warning: no -bucket specified" unless flags.bucket?
|
40
|
+
|
33
41
|
if flags.get && !flags.name
|
34
42
|
raise RuntimeError, "You must specify the name of a backup (--name)"
|
35
43
|
end
|
data/lib/mysql_backup.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: sqlup
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-06-
|
6
|
+
version: 0.0.2
|
7
|
+
date: 2007-06-23 00:00:00 -07:00
|
8
8
|
summary: A backup tool for saving MySQL data to Amazon's S3 service
|
9
9
|
require_paths:
|
10
10
|
- lib
|