remotebackup 0.50.5 → 0.50.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/remotebackup.rb +10 -7
- metadata +1 -1
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.6'
|
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+(.*)/
|
@@ -22,7 +22,7 @@ module Remotebackup
|
|
22
22
|
def initialize(out)
|
23
23
|
if out =~ /[^\x20-\x7E]/
|
24
24
|
$log.error("#{out} includes irregular char. ignore.")
|
25
|
-
return
|
25
|
+
return
|
26
26
|
end
|
27
27
|
case out
|
28
28
|
when /^-/
|
@@ -165,8 +165,11 @@ module Remotebackup
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
def outputYaml()
|
168
|
-
|
169
|
-
|
168
|
+
FileUtils.rm(@outputFile)
|
169
|
+
f = output_dir + "/" + date_to_filename + ".yml"
|
170
|
+
File.open(f,"w") do |f|
|
171
|
+
f.write YAML.dump(@fileMap)
|
172
|
+
end
|
170
173
|
end
|
171
174
|
def cleanFileInfo()
|
172
175
|
FileUtils.rm(@outputFile)
|
@@ -215,9 +218,9 @@ module Remotebackup
|
|
215
218
|
file_name = output_dir + "/" + key + date_to_filename
|
216
219
|
orig = "#{@path}/#{key}".gsub(/ /,"\\ ")
|
217
220
|
dest = file_name.gsub(/ /,"\\ ")
|
218
|
-
msg_out "scp #{
|
219
|
-
ssh.scp.download!(orig,
|
220
|
-
val["file_name"] =
|
221
|
+
msg_out "scp #{orig} #{dest}"
|
222
|
+
ssh.scp.download!(orig,dest)
|
223
|
+
val["file_name"] = dest
|
221
224
|
if !oldFileMap[key]
|
222
225
|
msg_out "create file:#{key}"
|
223
226
|
else
|