struggle 2.3.6 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/struggle/backup.rb +13 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80baef3cddc4ff506f15cb285aa4e635156858c5
4
- data.tar.gz: 1d37cf7398b8c2326072da3502dc800e1b5d8422
3
+ metadata.gz: a452bc1852b7b410115dfdcd030abca2188f4695
4
+ data.tar.gz: c61ce12a7b2de6d6d10c4caa38c30dfd52d052f1
5
5
  SHA512:
6
- metadata.gz: 64c3f18846f0c6802451ddfddebdfe43206f61e4c97b425eb174cc4536cb26e488bda423d5413923bd62c9ee5b031c8f2848b39487ab3a3a996ae86c82411fc7
7
- data.tar.gz: 9e28466f11ec697087eeae226d2dbb2a3c80b03826392e941df13bef9e6914304cc57c8b7d7e16525eff37dd7315485b4d6c25034d6fa3d852071b709a9e2b9d
6
+ metadata.gz: dc0eac6bae646c04d5f3557caab40bbc42a7d6f7cb2cc559aedaee81013b73bcd2dfbee99e0917e785d04f31a59a6c35b99f9a729819ce157bf340bbd8cdc0f1
7
+ data.tar.gz: 237a20d3a4ecbfe8c9ceaa1a9bbdea9a0cf6d4011619de9681c6f1d2036d9291c72b1f95014beaafe1119dd7e9a348b005d71e97a3e6450c3f9b59cff6931b6c
@@ -1,4 +1,16 @@
1
1
  # 备份数据库和文件
2
+ # 数据库配置
3
+ # mysql数据库配置
4
+ # 修改mysql配置文件 /etc/mysql/conf.d/mysqldump.cnf 在client 或者 mysqldump节点下增加host/user/password,导出时可以不用配置密码。
5
+ # [mysqldump]
6
+ # host=localhost
7
+ # user=root
8
+ # password='123456'
9
+ # postgresql数据库配置
10
+ # 在pg_hba.conf中添加用户访问认证trust(要重启),一行所有用户all,二行postgres用户
11
+ # TYPE DATABASE USER ADDRESS METHOD
12
+ # host all all 192.168.12.10/32 trust
13
+ # host all postgres 192.168.12.10/32 trust
2
14
  # 生成配置文件命令 rails g struggle:sql_config
3
15
  # Struggle::Backup.new.do 执行备份
4
16
  module Struggle
@@ -22,7 +34,7 @@ module Struggle
22
34
  _filename = "#{@@config["database"]}-#{@@now.strftime("%Y%m%d%H%M%S")}"
23
35
  filename = @@config["adapter"] == "oracle_enhanced" ? "#{_filename}.dmp" : "#{_filename}.sql"
24
36
  if @@config["adapter"] == "mysql2"
25
- system("mysqldump -u#{@@config["username"]} -p#{@@config["password"]} -d #{@@config["database"]}>#{filename}")
37
+ system("mysqldump -u#{@@config["username"]} #{@@config["database"]}>#{filename}")
26
38
  elsif @@config["adapter"] == "postgresql"
27
39
  system("pg_dump -U #{@@config["username"]} -d #{@@config["database"]} -E utf8 -f #{filename} -w")
28
40
  elsif @@config["adapter"] == "oracle_enhanced"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: struggle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.6
4
+ version: 2.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - lean