Class: Oldtime::Rsync

Inherits:
Object
  • Object
show all
Defined in:
lib/oldtime/rsync.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(end_cmd, name) ⇒ Rsync

Returns a new instance of Rsync.



7
8
9
10
# File 'lib/oldtime/rsync.rb', line 7

def initialize(end_cmd, name)
  @end_cmd = ERB.new(end_cmd).result(binding)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/oldtime/rsync.rb', line 5

def name
  @name
end

Instance Method Details

#runObject



12
13
14
15
16
17
# File 'lib/oldtime/rsync.rb', line 12

def run
  cmd = build_cmd(@end_cmd)

  File.append(Rc.p.logfile.p, "\n#{'='*30}\n#{'='*10} rsync #{name} #{'='*10}\n#{'='*30}\n\n")
  system cmd, :verbose => true
end