[GNU/Linux] How to copy files recursively using wget with ftp protocol

| | 1 min read

We had just completed switching our site from Windows IIS MySQL PHP to LAMP environment. As the deployment was via git, we downloaded project files with the ftp credentials and deployed the site via git. However, the 'sites/default/files' folder were of some GBs in size. We only had ftp credentials and was unable to get a compressed copy due to certain reasons. What we did to resolve the problem was use wget command to copy files recursively.

First of all, login to linux sever with the credentials, and use the following command to get the files folder. Note here that the user name is your ftp username and password is ftp password.



wget -r --user=username --password='password' ftp://hostname/sites/default/files

That's all, the source is copied.