To use the rsync
command over FTP, you need to use a wrapper such as lftp
. Here’s how:
- Install
lftp
:
sudo apt-get update
sudo apt-get install lftp
- Connect to the FTP server:
lftp ftp://<user>:<password>@<hostname>:<port>
Replace <user>
, <password>
, <hostname>
, and <port>
with the appropriate values for your FTP server.
- Run the
rsync
command:
mirror -R --no-perms --verbose <local_dir> <remote_dir>
Replace <local_dir>
with the path to the local directory to be synced, and <remote_dir>
with the path to the remote directory to be synced.
This will use rsync
to mirror the local directory to the remote FTP server. The -R
option specifies that the transfer should be done in reverse (from local to remote), and the --no-perms
option disables the transfer of permissions. The --verbose
option provides verbose output.