Class: Cfruby::FileOps::RsyncFileCommand
- Inherits:
-
Object
- Object
- Cfruby::FileOps::RsyncFileCommand
- Defined in:
- lib/libcfruby/fileops.rb
Overview
FileCommand interface for rsync operations
Instance Method Summary collapse
-
#copy(filename, newfilename, options = {}) ⇒ Object
- Options:
:archive
- Equivilant to -a in the rsync command
:recursive
- Recursive
:flags
-
Passed directly to the rsync command.
- Recursive
- Equivilant to -a in the rsync command
- Options:
-
#move(filename, newfilename, options = {}) ⇒ Object
- Options:
:user
- The user to use on the remote side
:archive
- Equivilant to -a in the rsync command
:recursive
- Recursive
:flags
-
Passed directly to the rsync command.
- Recursive
- Equivilant to -a in the rsync command
- The user to use on the remote side
- Options:
Instance Method Details
#copy(filename, newfilename, options = {}) ⇒ Object
Options:
:archive
-
Equivilant to -a in the rsync command
:recursive
-
Recursive
:flags
-
Passed directly to the rsync command
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/libcfruby/fileops.rb', line 237 def copy(filename, newfilename, = {}) flags = Array.new() if([:flags]) flags << [:flags] end if([:archive]) flags << "-a" end if([:recursive]) flags << "-r" end rsynccommand = "rsync #{flags.join(' ')} #{filename} #{newfilename}" Cfruby.controller.attempt(rsynccommand, 'destructive', 'unknown') { Cfruby::Exec.exec(rsynccommand) } end |
#move(filename, newfilename, options = {}) ⇒ Object
Options:
:user
-
The user to use on the remote side
:archive
-
Equivilant to -a in the rsync command
:recursive
-
Recursive
:flags
-
Passed directly to the rsync command
229 230 |
# File 'lib/libcfruby/fileops.rb', line 229 def move(filename, newfilename, = {}) end |