What is rsync?
The unix-y command rsync will “synchronize” the contents of one directory to another, by copying (and optionally deleting) the files and directories. It works both locally and for “remote” hosts that have rsync enabled.
How does it work?
This is a command-line utility that you enter into your terminal shell using syntax like rsync [options] src dst:
rsync -a dir1/ user@remote_host:dir2 rsync -a user@remote_host:/home/user/dir1 /path-to-sync
The following examples are from digital ocean
BASIC IN-SYSTEM
src is always first argument, destination is always second
rsync -a dir1/ dir2 sync dir1/* to dir2/[files]
The slashes are important! If you leave it off the src it will *MOVE* dir1 to dir2