daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tempfile = "#{Rails.root}/tmp/#{Process.pid}_#{MyApp::Application.config.products_bbcom_file}"
  2.       ftp = Net::FTP.new()
  3.       puts "connecting to ftp server #{MyApp::Application.config.products_bbcom_host}"
  4.       ftp.connect(MyApp::Application.config.products_bbcom_host)
  5.       puts "logging in"
  6.       ftp.login(MyApp::Application.config.products_bbcom_user,MyApp::Application.config.products_bbcom_pass)
  7.       puts "changing directory"
  8.       files = ftp.chdir(MyApp::Application.config.products_bbcom_path)
  9.       #files = ftp.list('n*')
  10.       puts "downloading file #{MyApp::Application.config.products_bbcom_file} to #{tempfile}"
  11.       ftp.getbinaryfile(MyApp::Application.config.products_bbcom_file, tempfile, 1024)
  12.       ftp.close
  13.    
  14. 2012-09-10T16:26:24+00:00 heroku[run.1]: Awaiting client
  15. 2012-09-10T16:26:24+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:import`
  16. 2012-09-10T16:26:25+00:00 heroku[run.1]: State changed from starting to up
  17.    
  18. == Starting ==
  19. Connecting to database specified by DATABASE_URL
  20. connecting to ftp server datatransfer.cj.com
  21. logging in
  22. changing directory
  23. downloading file
  24.    
  25. ftp = Net::FTP.new()
  26. ftp.passive = true
  27. ftp.connect(host)
  28. ftp.login(username,password)
  29. files = ftp.chdir(path_to_file)
  30. ftp.getbinaryfile(filename, tempfile, 1024)
  31. ftp.close
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top