Thursday, September 13, 2012

Recursive Automatic download of FTP files in Unix

With unix there comes numerous built in beautiful utilities. If one understands these utilities fully, he/she can accomplish seemingly difficult tasks in a jiffy.

One such thing that we always try to do it downloading a bunch of files from a FTP site. This becomes even tricky if there are many sub folders.

One such utility is wget.

A command line to recursively download all the files from an FTP location:

wget -r ftp://user:password@myremotehost -o /tmp/log &

'&' will make the process background, and output in /tmp/log file.

Easy money.