dumpr 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/dumpr/cli.rb +8 -4
- data/lib/dumpr/driver.rb +1 -1
- data/lib/dumpr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c4e092e069d3b3a1a9ddb44c6e4fae4b405c49510fce4e89ef1577bed0a6016
|
4
|
+
data.tar.gz: ea58fb39085ea624683a026f3fce5ddabe4cdbf2f1a3c8c5d69621067cc3bb01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53283e55f775af19059ee12c578e05012a5c141409e9484b562884bd80eb1b8ddfb34677753a3e6d37194367c12e3e904c9f712b2d57b5e93a602701a3a9cba5
|
7
|
+
data.tar.gz: 31d4147d81e4cede85aa7d70fef0707a00491415262487cfc9d9df5403ba56eb1cec02d92340ed458cbcfa4fc47c0627aa32dd9a68a2a13519ea9193c9fcbf92
|
data/README.md
CHANGED
@@ -32,14 +32,14 @@ The *dumpr* command can be used to export and import database dumps.
|
|
32
32
|
Generate yourdb.sql.gz and transfer it to server2
|
33
33
|
|
34
34
|
```sh
|
35
|
-
dumpr --user user --password pw --db yourdb --
|
35
|
+
dumpr --user user --password pw --db yourdb --file yourdb.sql --destination dbserver2:/data/dumps/
|
36
36
|
```
|
37
37
|
|
38
38
|
*Importing*
|
39
39
|
|
40
40
|
Then, over on dbserver2, import your dump file
|
41
41
|
```sh
|
42
|
-
dumpr -i --user user --password pw --
|
42
|
+
dumpr -i --user user --password pw --file /data/dumps/yourdb.sql
|
43
43
|
```
|
44
44
|
|
45
45
|
## Ruby API
|
@@ -64,7 +64,7 @@ Then, over on dbserver2, import your dump file
|
|
64
64
|
Dumpr::Driver::Mysql.import(
|
65
65
|
:user => 'importuser', :pass => 'pass',
|
66
66
|
:db => 'yourdb',
|
67
|
-
:
|
67
|
+
:file => '/data/dumps/yourdb.sql'
|
68
68
|
)
|
69
69
|
```
|
70
70
|
|
data/lib/dumpr/cli.rb
CHANGED
@@ -22,11 +22,11 @@ Usage: #{PROG_NAME} [options]
|
|
22
22
|
|
23
23
|
Exporting:
|
24
24
|
|
25
|
-
#{PROG_NAME} --user
|
25
|
+
#{PROG_NAME} --user root --password yourpass --db yourdb --file yourdb.sql --destination server2:/data/backups
|
26
26
|
|
27
27
|
Importing:
|
28
28
|
|
29
|
-
#{PROG_NAME} -i --user
|
29
|
+
#{PROG_NAME} -i --user root --password yourpass --db yourdb --file /data/backups/yourdb.sql
|
30
30
|
|
31
31
|
Don't forget to set up your .ssh/config so you won't be prompted for ssh passwords for file transfers
|
32
32
|
|
@@ -75,11 +75,15 @@ ENDSTR
|
|
75
75
|
options[:port] = val
|
76
76
|
end
|
77
77
|
|
78
|
-
opts.on("--
|
78
|
+
opts.on("--file FILENAME", "Filename of dump to create/import") do |val|
|
79
79
|
options[:dumpfile] = val
|
80
80
|
end
|
81
81
|
|
82
|
-
opts.on("--
|
82
|
+
opts.on("--dumpfile FILENAME", "Alias for --file") do |val|
|
83
|
+
options[:dumpfile] = val
|
84
|
+
end
|
85
|
+
|
86
|
+
opts.on("--destination DESTINATION", "Destination for dumpfile. This can be a remote host:path.") do |val|
|
83
87
|
options[:destination] = val
|
84
88
|
end
|
85
89
|
|
data/lib/dumpr/driver.rb
CHANGED
@@ -66,7 +66,7 @@ module Dumpr
|
|
66
66
|
@gzip = opts[:gzip].nil? ? true : opts[:gzip]
|
67
67
|
@gzip_options = opts[:gzip_options] || "-9"
|
68
68
|
@dumpdir = opts[:dumpdir] || "./"
|
69
|
-
@dumpfile = (opts[:dumpfile] || opts[:filename]) or raise BadConfig.new ":dumpfile => <file.sql> is required"
|
69
|
+
@dumpfile = (opts[:file] || opts[:dumpfile] || opts[:filename]) or raise BadConfig.new ":dumpfile => <file.sql> is required"
|
70
70
|
@dumpfile = @dumpfile[0].chr == "/" ? @dumpfile : File.join(@dumpdir, @dumpfile)
|
71
71
|
@dumpfile.chomp!(".gz")
|
72
72
|
# (optional) :destination is where dumps are exported to, and can be a remote host:path
|
data/lib/dumpr/version.rb
CHANGED