mysql_truck 0.3.0 → 0.4.0
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/bin/mysql_truck +4 -0
- data/lib/mysql_truck.rb +1 -1
- data/lib/mysql_truck/loader.rb +7 -3
- data/lib/mysql_truck/version.rb +1 -1
- metadata +4 -4
data/bin/mysql_truck
CHANGED
@@ -48,6 +48,10 @@ parser = OptionParser.new do |opts|
|
|
48
48
|
options[:bucket] = bucket
|
49
49
|
end
|
50
50
|
|
51
|
+
opts.on("-a", "--backup-date DATE", "Backup date to load from", "e.g., --backup-date '2011-01-01'") do |backup_date|
|
52
|
+
options[:backup_date] = backup_date
|
53
|
+
end
|
54
|
+
|
51
55
|
opts.on("--bucket-dir BUCKET_DIR", "S3 bucket dir [defaults to database name]") do |dir|
|
52
56
|
options[:bucket_dir] = dir
|
53
57
|
end
|
data/lib/mysql_truck.rb
CHANGED
data/lib/mysql_truck/loader.rb
CHANGED
@@ -18,11 +18,15 @@ module MysqlTruck
|
|
18
18
|
config[:only_tables] || []
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
|
21
|
+
def load_backup
|
22
|
+
# Default to latest backup
|
23
|
+
unless config[:backup_date]
|
24
|
+
backup_date_str = backups.first.split("/").last
|
25
|
+
end
|
23
26
|
|
24
27
|
# Set directory where backup is downloaded to
|
25
|
-
@time = Time.new(
|
28
|
+
@time = Time.new(backup_date_str.split("-"))
|
29
|
+
|
26
30
|
initialize_directories
|
27
31
|
|
28
32
|
puts "Download & gunzip backups"
|
data/lib/mysql_truck/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_truck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-09-18 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: right_aws
|
18
|
-
requirement: &
|
18
|
+
requirement: &70248160930520 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70248160930520
|
27
27
|
description: Mysql database backup tool. Dumps/Loads to/from S3.
|
28
28
|
email:
|
29
29
|
- peter@paydrotalks.com
|