Class: Vfs::Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/vos/box/vfs.rb,
lib/vos/helpers/ubuntu.rb

Instance Method Summary collapse

Instance Method Details

#bash(cmd, *args) ⇒ Object



44
45
46
# File 'lib/vos/box/vfs.rb', line 44

def bash cmd, *args      
  storage.bash_without_path "cd #{path} && #{cmd}", *args
end

#rsync_to(entry) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/vos/helpers/ubuntu.rb', line 51

def rsync_to entry
  raise "invalid argument!" unless entry.is_a? Entry      
  raise "#{path} must be a Dir" unless dir?
  raise "#{entry.path} can't be a File!" if entry.file?
  
  if local? and !entry.local?
    Box.local.bash("rsync -e 'ssh' -al --delete --stats --progress #{path}/ root@#{entry.storage.host}:#{entry.path}")
  elsif entry.local? and !local?        
    Box.local.bash("rsync -e 'ssh' -al --delete --stats --progress root@#{storage.host}:#{path}/ #{entry.path}")
  else
    raise "invalid usage!"
  end
end