Class: Awss3sync::Awss3sync

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/awss3sync.rb

Instance Method Summary collapse

Instance Method Details

#listObject



28
29
30
31
# File 'lib/awss3sync.rb', line 28

def list
  aws?
  say list_contents
end

#syncObject



45
46
47
48
49
50
51
# File 'lib/awss3sync.rb', line 45

def sync
  aws?
  list_contents.reject{|directory| directory == 'backups/'}.each do |dir|
    say "Syncing: #{dir} From: #{options[:from]} To: #{options[:to]}"
    %x{aws s3 sync #{options[:protocol]}#{options[:from]}/#{dir} #{options[:protocol]}#{options[:to]}/#{dir}}
  end
end