s3mybackup 0.0.3 → 0.0.4
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/s3mybackup +9 -14
- data/lib/s3mybackup/version.rb +1 -1
- metadata +4 -4
data/bin/s3mybackup
CHANGED
|
@@ -122,7 +122,7 @@ end
|
|
|
122
122
|
desc 'Describe restore here'
|
|
123
123
|
arg_name 'Describe arguments to restore here'
|
|
124
124
|
command :restore do |c|
|
|
125
|
-
c.desc 'Restore the binary logs'
|
|
125
|
+
c.desc 'Restore the binary logs without only the dump of mysqldump is restored'
|
|
126
126
|
c.switch [:l, :logs]
|
|
127
127
|
|
|
128
128
|
c.desc 'IP address of server without the dots'
|
|
@@ -147,14 +147,9 @@ command :restore do |c|
|
|
|
147
147
|
|
|
148
148
|
bucket = get_bucket global_options
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
to_database = args[1]
|
|
152
|
-
|
|
153
|
-
unless to_database then
|
|
154
|
-
to_database = from_database
|
|
155
|
-
end
|
|
150
|
+
database = args[0]
|
|
156
151
|
|
|
157
|
-
database_dir = get_database_dir(
|
|
152
|
+
database_dir = get_database_dir(database, ip)
|
|
158
153
|
|
|
159
154
|
full_backup_file_name = get_full_backup_file_name(time)
|
|
160
155
|
|
|
@@ -167,7 +162,7 @@ command :restore do |c|
|
|
|
167
162
|
# restore the dump file
|
|
168
163
|
cmd = "gunzip -c #{@temp_dir}/#{full_backup_file_name} | mysql -u #{user} "
|
|
169
164
|
cmd += " -p'#{password}' " unless password.nil?
|
|
170
|
-
cmd += " #{
|
|
165
|
+
cmd += " #{database}"
|
|
171
166
|
run_system cmd
|
|
172
167
|
|
|
173
168
|
if options[:logs] then
|
|
@@ -187,9 +182,9 @@ command :restore do |c|
|
|
|
187
182
|
# restore the binary log files
|
|
188
183
|
logs.each do |log|
|
|
189
184
|
# The following will be executed for each binary log file
|
|
190
|
-
cmd = "mysqlbinlog --database=#{
|
|
185
|
+
cmd = "mysqlbinlog --database=#{database} #{log} | mysql -u #{user} "
|
|
191
186
|
cmd += " -p'#{password}' " unless password.nil?
|
|
192
|
-
cmd += " #{
|
|
187
|
+
cmd += " #{database}"
|
|
193
188
|
run_system cmd
|
|
194
189
|
end
|
|
195
190
|
end
|
|
@@ -201,9 +196,9 @@ pre do |global, command, options, args|
|
|
|
201
196
|
raise "Database name is required."
|
|
202
197
|
end
|
|
203
198
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
199
|
+
if args.length > 1 then
|
|
200
|
+
raise "Only one argument, database, is allowed."
|
|
201
|
+
end
|
|
207
202
|
|
|
208
203
|
@mysql_bin_log_dir = global[:mysql_bin_log_dir]
|
|
209
204
|
@temp_dir = global[:temp_dir]
|
data/lib/s3mybackup/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: s3mybackup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 23
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 4
|
|
10
|
+
version: 0.0.4
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Joris Wijlens
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2013-01-
|
|
18
|
+
date: 2013-01-04 00:00:00 +01:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|