load_remote_db 0.1.15 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/load_remote_db/version.rb +1 -1
- data/lib/tasks/load_remote_db.rake +7 -6
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 63c4996ab89ec10bbbbd08d0ccfc7ba12aa2b8b2bdc7970f22aae05218ab7ff2
|
4
|
+
data.tar.gz: 1cd36f3db709b347ce06500c4a4a0d9412314143fb4758281a6e933867d9e394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 823d5742a29d7ac8b349994c8ee8476d2b5198f23c96bacd15d812776f92cfc112e52d0b23033edb5379df77a901f641424ad4d2225d68db81be55da7be0ffa1
|
7
|
+
data.tar.gz: 9e6d656da8f0cc60272ed51eab4ad5f88889fb518949d57779b7d7b2f25dbfd3941e14fc2e1d2f334e5e69a10ca406a4d8089ec2a52e9fe3d1ddbfffd25bd997
|
@@ -47,15 +47,16 @@ class RemoteDbLoader
|
|
47
47
|
|
48
48
|
puts get_db_info_command
|
49
49
|
remote_db_config = eval `#{get_db_info_command}`
|
50
|
-
remote_db_username = remote_db_config["username"] || 'root'
|
51
|
-
remote_db_password = remote_db_config["password"]
|
52
50
|
remote_db_host = remote_db_config["host"] || 'localhost'
|
53
51
|
remote_db_name = remote_db_config["database"]
|
52
|
+
remote_db_username = remote_db_config["username"] || 'root'
|
53
|
+
remote_db_password = remote_db_config["password"]
|
54
54
|
|
55
55
|
## run the real backup
|
56
56
|
puts 'Running the remote backup...'
|
57
57
|
mysql_cmd = "mysqldump -u #{remote_db_username} -p'#{remote_db_password}' \
|
58
|
-
-h #{remote_db_host} #{remote_db_name} >
|
58
|
+
-h #{remote_db_host} --set-gtid-purged=OFF #{remote_db_name} > \
|
59
|
+
#{shared_path}/backup.sql".shellescape
|
59
60
|
backup_command = %(ssh #{@server_user}@#{@server_ip} -p#{port} #{mysql_cmd})
|
60
61
|
system(backup_command)
|
61
62
|
|
@@ -115,10 +116,10 @@ class RemoteDbLoader
|
|
115
116
|
|
116
117
|
if to_be_rsync_folder
|
117
118
|
puts "Synchorinizing #{to_be_rsync_folder} folder..."
|
118
|
-
`mkdir -p
|
119
|
+
`mkdir -p #{to_be_rsync_folder}`
|
119
120
|
sync_folder_cmd = %(rsync -r \
|
120
|
-
#{@server_user}@#{@server_ip}:#{shared_path}/#{to_be_rsync_folder} \
|
121
|
-
|
121
|
+
#{@server_user}@#{@server_ip}:#{shared_path}/#{to_be_rsync_folder}/ \
|
122
|
+
#{to_be_rsync_folder})
|
122
123
|
puts sync_folder_cmd
|
123
124
|
system(sync_folder_cmd)
|
124
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: load_remote_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Huynh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
|
-
|
80
|
-
rubygems_version: 2.6.11
|
79
|
+
rubygems_version: 3.0.3
|
81
80
|
signing_key:
|
82
81
|
specification_version: 4
|
83
82
|
summary: Load MySQL Remote DB for Mina/Capistrano
|