remotebackup 0.50.2 → 0.50.4
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/lib/remotebackup.rb +22 -22
- 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.4'
|
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+(.*)/
|
@@ -21,7 +21,7 @@ module Remotebackup
|
|
21
21
|
|
22
22
|
def initialize(out)
|
23
23
|
@name=""
|
24
|
-
if out
|
24
|
+
if out =~ /[^\x20-\x7E]/
|
25
25
|
$log.error("#{out} includes irregular char. ignore.")
|
26
26
|
end
|
27
27
|
case out
|
@@ -208,26 +208,26 @@ module Remotebackup
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
oldFileMap = oldFileInfoMap["file"]
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
211
|
+
Net::SSH.start(@server, @user, :password => @password) do |ssh|
|
212
|
+
@fileMap["file"].each do |key,val|
|
213
|
+
if !oldFileMap[key] || oldFileMap[key]["date"] != val["date"]
|
214
|
+
@mod = true
|
215
|
+
file_name = output_dir + "/" + key + date_to_filename
|
216
|
+
orig = "#{@path}/#{key}".gsub(/ /,"\\ ")
|
217
|
+
dest = file_name.gsub(/ /,"\\ ")
|
218
|
+
msg_out "scp #{@user}@#{@server}:#{orig} #{dest} #password=#{@password}"
|
219
|
+
ssh.scp.download!(orig,file_name)
|
220
|
+
val["file_name"] = file_name
|
221
|
+
if !oldFileMap[key]
|
222
|
+
msg_out "create file:#{key}"
|
223
|
+
else
|
224
|
+
msg_out "modified file:#{key}"
|
225
|
+
end
|
226
|
+
else
|
227
|
+
val["file_name"] = oldFileMap[key]["file_name"]
|
228
|
+
end
|
229
|
+
end
|
230
|
+
end
|
231
231
|
end
|
232
232
|
def zerosup(i)
|
233
233
|
if i < 10
|