Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tempfile = "#{Rails.root}/tmp/#{Process.pid}_#{MyApp::Application.config.products_bbcom_file}"
- ftp = Net::FTP.new()
- puts "connecting to ftp server #{MyApp::Application.config.products_bbcom_host}"
- ftp.connect(MyApp::Application.config.products_bbcom_host)
- puts "logging in"
- ftp.login(MyApp::Application.config.products_bbcom_user,MyApp::Application.config.products_bbcom_pass)
- puts "changing directory"
- files = ftp.chdir(MyApp::Application.config.products_bbcom_path)
- #files = ftp.list('n*')
- puts "downloading file #{MyApp::Application.config.products_bbcom_file} to #{tempfile}"
- ftp.getbinaryfile(MyApp::Application.config.products_bbcom_file, tempfile, 1024)
- ftp.close
- 2012-09-10T16:26:24+00:00 heroku[run.1]: Awaiting client
- 2012-09-10T16:26:24+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:import`
- 2012-09-10T16:26:25+00:00 heroku[run.1]: State changed from starting to up
- == Starting ==
- Connecting to database specified by DATABASE_URL
- connecting to ftp server datatransfer.cj.com
- logging in
- changing directory
- downloading file
- ftp = Net::FTP.new()
- ftp.passive = true
- ftp.connect(host)
- ftp.login(username,password)
- files = ftp.chdir(path_to_file)
- ftp.getbinaryfile(filename, tempfile, 1024)
- ftp.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement