backup 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/backup/database/mysql.rb +15 -3
- data/lib/backup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa0b144330dcad2a6b8431298f2b67f74a7ef5ea
|
4
|
+
data.tar.gz: 45e786c86125a2a83620f3ba17c73adb6d144ec0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc0d62798b5de148dcd56980645875d423fceea53350657f532f7bd5499ae9bd7ee561d691a7a4a4bc7482ff691f94adc776c1f81aaf4f28abded8b5607e71d7
|
7
|
+
data.tar.gz: 4fed7271602ac403689a93665390d775e059c8d5758346752b35b4002bec1f05f9175704d0d5602c56f4f08b7346a8c72c33f57302dfe2820c9ce049c2c2f6d8
|
@@ -46,6 +46,12 @@ module Backup
|
|
46
46
|
# See: http://www.percona.com/doc/percona-xtrabackup/
|
47
47
|
attr_accessor :backup_engine
|
48
48
|
|
49
|
+
##
|
50
|
+
# If true (which is the default behaviour), the backup will be prepared
|
51
|
+
# after it has been successfuly created. This option is only valid if
|
52
|
+
# :backup_engine is set to :innobackupex.
|
53
|
+
attr_accessor :prepare_backup
|
54
|
+
|
49
55
|
##
|
50
56
|
# If set the backup engine command block is executed as the given user
|
51
57
|
attr_accessor :sudo_user
|
@@ -60,6 +66,7 @@ module Backup
|
|
60
66
|
|
61
67
|
@name ||= :all
|
62
68
|
@backup_engine ||= :mysqldump
|
69
|
+
@prepare_backup = true if @prepare_backup.nil?
|
63
70
|
end
|
64
71
|
|
65
72
|
##
|
@@ -151,14 +158,19 @@ module Backup
|
|
151
158
|
"#{ utility(:innobackupex) } #{ credential_options } " +
|
152
159
|
"#{ connectivity_options } #{ user_options } " +
|
153
160
|
"--no-timestamp #{ temp_dir } #{ quiet_option } && " +
|
154
|
-
|
155
|
-
"#{ utility(:innobackupex) } --apply-log #{ temp_dir } " +
|
156
|
-
"#{ user_prepare_options } #{ quiet_option } && " +
|
161
|
+
innobackupex_prepare +
|
157
162
|
# Move files to tar-ed stream on stdout
|
158
163
|
"#{ utility(:tar) } --remove-files -cf - " +
|
159
164
|
"-C #{ File.dirname(temp_dir) } #{ File.basename(temp_dir) }"
|
160
165
|
end
|
161
166
|
|
167
|
+
def innobackupex_prepare
|
168
|
+
return "" unless @prepare_backup
|
169
|
+
# Log applying phase (prepare for restore)
|
170
|
+
"#{ utility(:innobackupex) } --apply-log #{ temp_dir } " +
|
171
|
+
"#{ user_prepare_options } #{ quiet_option } && "
|
172
|
+
end
|
173
|
+
|
162
174
|
def sudo_option(command_block)
|
163
175
|
return command_block unless sudo_user
|
164
176
|
|
data/lib/backup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|