Linux / Unix: Use rsync Command Over FTP

To use the rsync command over FTP, you need to use a wrapper such as lftp. Here’s how:

  1. Install lftp:
sudo apt-get update
sudo apt-get install lftp
  1. 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.

  1. 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.

Leave a Comment