remotebackup 0.50.5 → 0.50.6

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.
Files changed (2) hide show
  1. data/lib/remotebackup.rb +10 -7
  2. 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.5'
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
- newFile = @outputFile.sub(/.txt$/,".yml")
169
- FileUtils.mv(@outputFile,newFile)
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 #{@user}@#{@server}:#{orig} #{dest} #password=#{@password}"
219
- ssh.scp.download!(orig,file_name)
220
- val["file_name"] = 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
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.5
4
+ version: 0.50.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - takeshi morita