backupit 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/backupit.gemspec +3 -7
- data/lib/backup/storage.rb +4 -4
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/backupit.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{backupit}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jinzhu"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-07-11}
|
13
13
|
s.default_executable = %q{backup}
|
14
14
|
s.description = %q{A tool to backup your servers}
|
15
15
|
s.email = %q{wosmvp@gmail.com}
|
@@ -39,12 +39,8 @@ Gem::Specification.new do |s|
|
|
39
39
|
]
|
40
40
|
s.homepage = %q{http://github.com/jinzhu/backupit}
|
41
41
|
s.require_paths = ["lib"]
|
42
|
-
s.rubygems_version = %q{1.
|
42
|
+
s.rubygems_version = %q{1.6.2}
|
43
43
|
s.summary = %q{A tool to backup your servers}
|
44
|
-
s.test_files = [
|
45
|
-
"test/helper.rb",
|
46
|
-
"test/test_backupit.rb"
|
47
|
-
]
|
48
44
|
|
49
45
|
if s.respond_to? :specification_version then
|
50
46
|
s.specification_version = 3
|
data/lib/backup/storage.rb
CHANGED
@@ -35,7 +35,7 @@ module Backup
|
|
35
35
|
@server_config.rsync.to_a.map do |path|
|
36
36
|
remote_path = path.is_a?(Hash) ? path.first[0] : path
|
37
37
|
target_name = File.basename(path.is_a?(Hash) ? path.first[1] : path)
|
38
|
-
self.changes << Backup::Main.run
|
38
|
+
self.changes << Backup::Main.run("rsync -ravk #{@rsync_host}:#{remote_path.sub(/\/?$/,'/')} '#{File.join(target_path, target_name)}'")
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -52,9 +52,9 @@ module Backup
|
|
52
52
|
mysql_config += " #{mysql.options}" if mysql.options
|
53
53
|
|
54
54
|
tmpfile = Tempfile.new('mysql.sql')
|
55
|
-
self.changes << Backup::Main.run("ssh #{@ssh_host} 'mysqldump #{mysql_config} > #{tmpfile.path}'") &&
|
56
|
-
self.changes << Backup::Main.run("scp #{@scp_host}:#{tmpfile.path} '#{target_path}/#{key}.sql'") &&
|
57
|
-
self.changes << Backup::Main.run("ssh #{@ssh_host} 'rm #{tmpfile.path}'")
|
55
|
+
(self.changes << Backup::Main.run("ssh #{@ssh_host} 'mysqldump #{mysql_config} > #{tmpfile.path}'")) &&
|
56
|
+
(self.changes << Backup::Main.run("scp #{@scp_host}:#{tmpfile.path} '#{target_path}/#{key}.sql'")) &&
|
57
|
+
(self.changes << Backup::Main.run("ssh #{@ssh_host} 'rm #{tmpfile.path}'"))
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
metadata
CHANGED