How to RSYNC­­

RSYNC is a command tool that's easy to use to copy files from a specific location to another, either locally, or externally. 

RSYNC helps to minimise the time necessary to move files by predetermining what is already at the final destination, and ensures that duplicate files aren't copied over. 

There are numerous different ways to copy files over, but each method uses the same command. 

Local

rsync -Pav /path/to/source /path/to/destination

External

Push Method:

rsync -Pav --rsh="ssh -p [SSH_Port]" /path/to/source USER@DESTINATION:/path/to/destination[/code]

Pull Method:

rsync -Pav --rsh="ssh -p [SSH_Port]" USER@SOURCE:/path/to/source /path/to/destination

Key:

USER - Username of remote account.

SOURCE - Source server’s IP address or hostname.

DESTINATION - Destination server’s IP address or hostname.

-Pav -P Shows progress of RSYNC. -a Archive mode (equivalent to -rlptgoD) and -v Verbose (give you information about what files are being transferred and a brief summary at the end).

-rlptgoD = r (recursive), l (links, copy symlinks as symlinks), p (perms, preserve permissions), t (times, preserve times), g (group, preserve group), o (owner, preserve owner (root only)), D (devices, preserve devices (root only))

--rsh - Specify the remote shell.

-p [SSH_Port] - Specify SSH port number. Replace [SSH_Port] with the actual port number.

Was this answer helpful? 0 Users Found This Useful (0 Votes)