Recursive FTP directory listing in shell/bash with a single session (using cURL or ftp)

Posted by Timo on Stack Overflow See other posts from Stack Overflow or by Timo
Published on 2010-04-10T17:57:08Z Indexed on 2010/04/10 18:03 UTC
Read the original article Hit count: 346

Filed under:
|
|
|
|

I am writing a little shellscript that needs to go through all folders and files on an ftp server (recursively). So far everything works fine using cURL - but it's pretty slow, becuase cURL starts a new session for every command. So for 500 directories, cURL preforms 500 logins.

Does anybody know, whether I can stay logged in using cURL (this would be my favourite solution) or how I can use ftp with only one session in a shell script?

I know how to execute a set of ftp commands and retrieve the response, but for the recursive listing, it has to be a little more dynamic...

Thanks for your help!

© Stack Overflow or respective owner

Related posts about shell

Related posts about bash