mys3ql 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mys3ql/mysql.rb +4 -3
- data/lib/mys3ql/s3.rb +8 -10
- data/lib/mys3ql/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: a48a2b78903816b36dda8e140c0a437d7321b9de
|
4
|
+
data.tar.gz: 698c6f810ec61c7b66313e4d0c6831c2ee62576a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 652a2869f4a3f54b2a7c63f8ec16aa0d26c59550cf27de8f2a7eca34202f746f53d9ac332000c4a79dac59307bdca42ad809cb5f613ab4a19eb43899dc1f04e9
|
7
|
+
data.tar.gz: c71c414fb1431c41899e5ccb438bb3e62fcef18e8f33fcb5580312a0f322bb4fce09ad560df66f3f6dec7893ae9cf3ff5042d11e148001ad2b5a3cdb9eae4bd2
|
data/lib/mys3ql/mysql.rb
CHANGED
@@ -45,9 +45,10 @@ module Mys3ql
|
|
45
45
|
# https://dev.mysql.com/doc/refman/5.7/en/flush.html#flush-logs
|
46
46
|
# https://dev.mysql.com/doc/refman/5.7/en/flush.html#flush-binary-logs
|
47
47
|
execute 'flush logs'
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
Dir.glob("#{@config.bin_log}.[0-9]*")
|
49
|
+
.sort_by { |f| f[/\d+/].to_i }
|
50
|
+
.slice(0..-2) # all logs except the last, which is newly created
|
51
|
+
.each do |log_file|
|
51
52
|
yield log_file
|
52
53
|
end
|
53
54
|
end
|
data/lib/mys3ql/s3.rb
CHANGED
@@ -14,7 +14,7 @@ module Mys3ql
|
|
14
14
|
s3_file = save file, key
|
15
15
|
if dump && s3_file
|
16
16
|
copy_key = key_for :latest
|
17
|
-
s3_file.copy_to key: copy_key
|
17
|
+
s3_file.copy_to bucket: bucket_name, key: copy_key
|
18
18
|
log "s3: copied #{key} to #{copy_key}"
|
19
19
|
end
|
20
20
|
end
|
@@ -50,7 +50,7 @@ module Mys3ql
|
|
50
50
|
def get(s3_key, local_file_name)
|
51
51
|
s3.get_object(
|
52
52
|
response_target: local_file_name,
|
53
|
-
bucket:
|
53
|
+
bucket: bucket_name,
|
54
54
|
key: s3_key
|
55
55
|
)
|
56
56
|
log "s3: pulled #{s3_key} to #{local_file_name}"
|
@@ -88,20 +88,22 @@ module Mys3ql
|
|
88
88
|
access_key_id: @config.access_key_id,
|
89
89
|
region: @config.region
|
90
90
|
)
|
91
|
-
log 's3: connected'
|
92
91
|
client
|
93
92
|
end
|
94
93
|
end
|
95
94
|
|
96
95
|
def bucket
|
97
96
|
@bucket ||= begin
|
98
|
-
b = Aws::S3::Bucket.new
|
99
|
-
raise "S3 bucket #{
|
100
|
-
log "s3: opened bucket #{@config.bucket}"
|
97
|
+
b = Aws::S3::Bucket.new bucket_name, client: s3
|
98
|
+
raise "S3 bucket #{bucket_name} not found" unless b.exists?
|
101
99
|
b
|
102
100
|
end
|
103
101
|
end
|
104
102
|
|
103
|
+
def bucket_name
|
104
|
+
@config.bucket
|
105
|
+
end
|
106
|
+
|
105
107
|
def dumps_prefix
|
106
108
|
"#{@config.database}/dumps"
|
107
109
|
end
|
@@ -109,9 +111,5 @@ module Mys3ql
|
|
109
111
|
def bin_logs_prefix
|
110
112
|
"#{@config.database}/bin_logs"
|
111
113
|
end
|
112
|
-
|
113
|
-
def bin_logs_exist?
|
114
|
-
@config.bin_log && @config.bin_log.length > 0 && File.exist?(@config.bin_log)
|
115
|
-
end
|
116
114
|
end
|
117
115
|
end
|
data/lib/mys3ql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mys3ql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|