Guest User

Untitled

a guest
Apr 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. # lib to fetch all batch througth ftp and get cover files and mp3
  2. require 'net/ftp'
  3.  
  4. class Batch
  5. def initialize(ftp)
  6. begin
  7. @ftp = ftp
  8. @ftp.login(FTPUSER, FTPPASS)
  9. rescue Exception => e
  10. raise e.message
  11. end
  12. end
  13.  
  14. def list_all
  15. p @ftp.list('batch_*')
  16. end
  17.  
  18. def close
  19. @ftp.close
  20. end
  21. end
  22.  
  23. FTPSERVER = "pias.kantik.net"
  24. FTPUSER = "pias.kantik.net"
  25. FTPPASS = "piaskantik"
  26. BATCH_DIR = "/Kantik"
  27.  
  28.  
  29. batch = Batch.new(Net::FTP.new(FTPSERVER))
  30. batch.list_all
  31. batch.close
Add Comment
Please, Sign In to add comment