remotebackup 0.50.8 → 0.50.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/restore_backup +5 -5
- data/lib/remotebackup.rb +12 -3
- metadata +3 -3
data/bin/restore_backup
CHANGED
@@ -48,11 +48,11 @@ def opt_parse()
|
|
48
48
|
$stderr.puts parser.help
|
49
49
|
exit 1
|
50
50
|
end
|
51
|
-
if FileTest.directory?($config_out_dir)
|
52
|
-
$stderr.puts "Error:output directory #{$config_out_dir} is already exist."
|
53
|
-
$stderr.puts parser.help
|
54
|
-
exit 1
|
55
|
-
end
|
51
|
+
# if FileTest.directory?($config_out_dir)
|
52
|
+
# $stderr.puts "Error:output directory #{$config_out_dir} is already exist."
|
53
|
+
# $stderr.puts parser.help
|
54
|
+
# exit 1
|
55
|
+
# end
|
56
56
|
end
|
57
57
|
opt_parse
|
58
58
|
rs=Remotebackup::Restore.new($config_file,$config_out_dir)
|
data/lib/remotebackup.rb
CHANGED
@@ -10,7 +10,7 @@ require "date"
|
|
10
10
|
require 'logger'
|
11
11
|
require 'yaml'
|
12
12
|
module Remotebackup
|
13
|
-
VERSION='0.50.
|
13
|
+
VERSION='0.50.9'
|
14
14
|
class Node
|
15
15
|
attr_accessor :ftype,:name,:makeMap
|
16
16
|
LS_FILE = /([-a-z]*)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\d*)\s+([A-Z][a-z]*)\s+(\d+)\s+([\d:]*)\s+(.*)/
|
@@ -208,9 +208,14 @@ module Remotebackup
|
|
208
208
|
if !oldFileMap[key] || oldFileMap[key]["date"] != val["date"]
|
209
209
|
@mod = true
|
210
210
|
file_name = output_dir + "/" + key + date_to_filename
|
211
|
-
orig = "#{@path}/#{key}".gsub(/ /,"\\ ")
|
211
|
+
orig = "#{@path}/#{key}".gsub(/ /,"\\ ").gsub(/\(/,"\\(").gsub(/\)/,"\\)").gsub(/&/,"\\\\&").gsub(/\=/,"\\=")
|
212
212
|
msg_out "scp #{orig} #{file_name}"
|
213
|
-
|
213
|
+
begin
|
214
|
+
ssh.scp.download!(orig,file_name)
|
215
|
+
rescue
|
216
|
+
$log.error("#{orig} can't copy. ignore.")
|
217
|
+
next
|
218
|
+
end
|
214
219
|
val["file_name"] = file_name
|
215
220
|
if !oldFileMap[key]
|
216
221
|
msg_out "create file:#{key}"
|
@@ -297,6 +302,10 @@ module Remotebackup
|
|
297
302
|
FileUtils.symlink(val["source"],@config_out_dir + "/" + key)
|
298
303
|
end
|
299
304
|
@file_info_map["file"].each do |key,val|
|
305
|
+
unless val['file_name']
|
306
|
+
$log.error("#{key} can't copy. ignore.")
|
307
|
+
next
|
308
|
+
end
|
300
309
|
msg_out "cp #{val['file_name']} #{@config_out_dir}/#{key}"
|
301
310
|
FileUtils.cp(val["file_name"],@config_out_dir + "/" + key)
|
302
311
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remotebackup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.50.
|
4
|
+
version: 0.50.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- takeshi morita
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-11-
|
12
|
+
date: 2008-11-25 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
requirements: []
|
103
103
|
|
104
104
|
rubyforge_project: remotebackup
|
105
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.3.1
|
106
106
|
signing_key:
|
107
107
|
specification_version: 2
|
108
108
|
summary: remote ssh backup is backup files on remote server with ssh
|