logo
. . .

How to move files on one server to another help of the rsync command

Step 1: Open a Terminal on Your Server.
Open a terminal on your server.

Step 2: Use rsync with SSH
Run the following rsync command in your server terminal:
rsync -avz -e ssh /path/to/source/ user@remote_server:/path/to/destination/
Explanation of the options:
-a (or –archive): Archive mode, preserving permissions, ownership, timestamps, and recursive copying.
-v (or –verbose): Increase verbosity to see the files as they are copied.
-z (or –compress): Compress file data during the transfer to reduce the amount of data sent.
-e ssh: Specifies the remote shell to use (in this case, SSH).
Replace /path/to/source/, user, remote_server, and /path/to/destination/ with your actual paths and server information.

Step 3: Enter SSH Password or Passphrase
If you haven’t set up SSH key authentication, you will be prompted to enter the password for the user on the remote server.

Step 4: Monitor the Transfer
As the rsync command runs, it will display information about the transfer, including the files being copied and progress. If you included the -v option, you will see more detailed output.

Step 5: Completion and Verification
Once the transfer is complete, rsync will display a summary. Verify that the files have been successfully copied to the destination.