How to download a directory over FTP?
I want to download a directory over FTP. The directory is very large, and it would be useful if I can pause and resume the download as needed.
The target FTP directory is static. That is, it’s contents won’t change in time. And no authentication is needed.
What’s the best tool to do this job?
You can do it with curl :
curl -u user:password 'ftp://site/folder/file.txt' -o /tmp/file.txt
or with gui FileZilla
wget should work:
wget -r -l 0 ftp://username:email@example.com/some_dir/*
wget is tool for downloading files.
-l 0for infinite recursion, because
-rby default have recursion depth of 5.
some_dir/is relative to user home dir. If you want absolute path add one more
/after host name.
Maybe you have to use
--password arguments to get it to work on Ubuntu.(according to https://stackoverflow.com/questions/113886/how-do-you-recursively-ftp-a-folder-in-linux)
I would use lftp and mirror function in it. You can download files in pararell, stop, resume, limit speed etc.
Alternativly – you can use wget
wget -m -c ftp://serwer/directory
If you wish to stop – simply stop wget. For resume – do it again – it will not download files which was already downloaded.
If you wish to download/reject specific files you can use -A or -R option (or – if you wish to specify it via regexp – –accept-regex/–reject-regex)
AFAIK ftp doesn’t support downloading the directory directly.
You can use
FileZilla for this purpose. It stores all your transfer in queue. You can resume the transfer later once it is paused or when you reconnect to server.
I tried those commands but wget interpreted user:pass has being the server and port so i ran this command and it worked, hope it help :
wget -m -c 'ftp://servidor/directory/' --ftp-user=<your ftp username> --ftp-password=<your ftp password>