How to download entire web site via FTP recursively using wget
Sometimes you need to download an enire website via FTP to your harddrive. This is needed if you want to make a backup or to move your site from one hosting provider to another. Of course you could use some GUI client like FileZilla, Midnight Commander or Gnome Commander. But what if you want to wrap the download process into shell script or maybe conduct the download as backgroud task to download one server's contents from another?
So, to download entire FTP site to the current directory using wget mirror mode (the -m command):
wget -m ftp://username:password@hostname.com
For security reasons, you can use --ask-password
to avoid password being kept in history
of shell's last typed commands
wget -m --ask-password ftp://username@hostname.com
The behavior is much the same, except that you will be asked for password separately
Source: serverfault.com
Professional Linux custom software programming.