Guest User

Untitled

a guest
May 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. require 'net/sftp'
  2.  
  3. Net::SFTP.start('site', 'username', :password => 'pass') do |sftp|
  4.  
  5. local_dir = "/home/user/put_files_here/"
  6. remote_dir = "/home/user/get_from_here/"
  7.  
  8. sftp.dir.foreach(remote_dir) do |entry|
  9. local_file = "#{local_dir}#{entry.name}"
  10. remote_file = "#{remote_dir}#{entry.name}"
  11. sftp.download!(remote_file, local_file)
  12. end
  13.  
  14. Errors:
  15. /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/operations/download.rb:307:in `on_open': open /Ecomm/Content_Feeds/US_Content_Feed/CWUS-RelNotes-INC-Mon-Aug-04-15-24-15-PST-2008-A-MV-90.xml.gz: failure (4) (RuntimeError)
  16. from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `to_proc'
  17. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/request.rb:87:in `call'
  18. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/request.rb:87:in `respond_to'
  19. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.rb:947:in `dispatch_request'
  20. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.rb:910:in `when_channel_polled'
  21. from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `to_proc'
  22. from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/connection/channel.rb:311:in `call'
  23. from /usr/lib/ruby/gems/1.8/gems/net-ssh-2.0.4/lib/net/ssh/connection/channel.rb:311:in `process'
  24. ... 28 levels...
  25. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.rb:801:in `loop'
  26. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp/session.rb:786:in `connect!'
  27. from /usr/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib/net/sftp.rb:32:in `start'
  28. from ./medianet.rb:6
  29.  
  30. from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `to_proc'
Add Comment
Please, Sign In to add comment