rayback 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/db2fog.rb +6 -3
- metadata +3 -3
data/lib/db2fog.rb
CHANGED
@@ -10,9 +10,11 @@ require 'db2fog/railtie'
|
|
10
10
|
class DB2Fog
|
11
11
|
cattr_accessor :config
|
12
12
|
|
13
|
-
def backup
|
13
|
+
def backup *args
|
14
|
+
options = args.extract_options!
|
14
15
|
file_name = "dump-#{db_credentials[:database]}-#{Time.now.utc.strftime("%Y%m%d%H%M")}.sql.gz"
|
15
|
-
|
16
|
+
Kernel.p options
|
17
|
+
store.store(file_name, open(database.dump(options)))
|
16
18
|
store.store(most_recent_dump_file_name, file_name)
|
17
19
|
end
|
18
20
|
|
@@ -91,8 +93,9 @@ class DB2Fog
|
|
91
93
|
flags = "--quick --single-transaction --create-options"
|
92
94
|
cmd = "mysqldump #{flags} #{mysql_options} #{options[:database]} " + options[:tables].join(" ")
|
93
95
|
cmd += " | gzip -9 > #{dump_file.path}"
|
96
|
+
puts cmd
|
94
97
|
run(cmd)
|
95
|
-
|
98
|
+
Kernel.p dump_file.path
|
96
99
|
dump_file.path
|
97
100
|
end
|
98
101
|
|
metadata
CHANGED