Class: Oldtime::Rsync
- Inherits:
-
Object
- Object
- Oldtime::Rsync
- Defined in:
- lib/oldtime/rsync.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(end_cmd, name) ⇒ Rsync
constructor
A new instance of Rsync.
- #run ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/oldtime/rsync.rb', line 5 def name @name end |
Instance Method Details
#run ⇒ Object
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 |