mysql_truck 0.0.4 → 0.0.5
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/version.rb +1 -1
- data/lib/mysql_truck.rb +4 -14
- metadata +3 -3
data/bin/mysql_truck
CHANGED
@@ -52,6 +52,10 @@ parser = OptionParser.new do |opts|
|
|
52
52
|
options[:bucket_dir] = key
|
53
53
|
end
|
54
54
|
|
55
|
+
opts.on("--dump-dir DIR", "Directory where the mysql dumps will go before upload/download.", "Defaults to /tmp") do |dir|
|
56
|
+
options[:dump_dir] = dir
|
57
|
+
end
|
58
|
+
|
55
59
|
opts.on("-t", "--skip-tables TABLES",
|
56
60
|
"List of tables to skip separated by commas.") do |tables|
|
57
61
|
options[:skip_tables] = tables.split(",")
|
data/lib/mysql_truck/version.rb
CHANGED
data/lib/mysql_truck.rb
CHANGED
@@ -64,10 +64,10 @@ module MysqlTruck
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def base_path
|
67
|
-
if config[:
|
68
|
-
config[:
|
67
|
+
if config[:dump_dir]
|
68
|
+
config[:dump_dir].is_a?(Pathname) ? config[:dump_dir].join("mysqltruck") : Pathname.new(config[:dump_dir]).join("mysqltruck")
|
69
69
|
else
|
70
|
-
Pathname.new("/
|
70
|
+
Pathname.new("/tmp/mysqltruck")
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -146,7 +146,6 @@ module MysqlTruck
|
|
146
146
|
unless @tables
|
147
147
|
res = `mysql #{db_connection_options} -e "SHOW TABLES"`
|
148
148
|
@tables = res.split[1..-1]
|
149
|
-
# @tables = res.split[1..10]
|
150
149
|
end
|
151
150
|
@tables
|
152
151
|
end
|
@@ -216,7 +215,7 @@ module MysqlTruck
|
|
216
215
|
|
217
216
|
puts "Backup loaded."
|
218
217
|
ensure
|
219
|
-
|
218
|
+
remove_directories
|
220
219
|
end
|
221
220
|
|
222
221
|
# Get a list of backups stored on S3.
|
@@ -239,14 +238,5 @@ module MysqlTruck
|
|
239
238
|
end
|
240
239
|
@backups
|
241
240
|
end
|
242
|
-
|
243
|
-
def tables
|
244
|
-
unless @tables
|
245
|
-
res = `mysql #{db_connection_options} -e "SHOW TABLES"`
|
246
|
-
@tables = res.split[1..-1]
|
247
|
-
end
|
248
|
-
@tables
|
249
|
-
end
|
250
|
-
|
251
241
|
end # class Loader
|
252
242
|
end
|
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ default_executable:
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: right_aws
|
18
|
-
requirement: &
|
18
|
+
requirement: &2164477260 !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: *2164477260
|
27
27
|
description: Mysql database backup tool. Dumps/Loads to/from S3.
|
28
28
|
email:
|
29
29
|
- peter@paydrotalks.com
|