Mirroring a directory over ftp.
Unfortunately rsync doesn’t support mirroring over ftp, but thats where lftp comes in handy.
To recursively copy (mirror) a remote directory named data to a directory named /ftp_mirror in the current machine:
lftp user@example.com:/pub> mirror -v data /ftp_mirror
Where:
* mirror: the mirror command
* -v: the verbose flag, so you can see which file is being copied
To mirror a directory on your machine called /data/remote_copy to the remote ftp server:
lftp user@example.com:/pub> mirror -Rv /data/remote_copy .
Where:
* -R: this is a reverse mirror, e.g Copy from local machine to remote machine
This will create a directory called /pub/remote_copy with the contents of the /data/remote_copy.