rsync is a unix command line tool for syncing two folders. It can sync locally or over the network using SSH.
Usage:
rsync -arvu --dry-run --delete "/path/to/source" "/path/to/destination"
This will sync the entire source folder into destination. If you want to sync the contents of source, you need to use a trailing slash, like so "/path/to/source/"
Some flags:
-a,--archiveArchive mode (Do the sync preserving all filesystem attributes)-v,--verboserun verbosely-r,--recursiverun recursively-t,--timesrun recursively-u,--updateonly copy files with a newer modification time (or size difference if the times are equal)-conly copy files with a different checksum (this could be helpful when there are changes of-unot giving the desired results. But since it generates a 128-bit md4 hash of the file it will take longer than-u)-L,--copy-linkstransform symlink into referent file/dir--deletedelete the files in target folder that do not exist in the source--dry-runwill give us the output, but not do the actual sync. Perfect for testing commands before you commit to it
Modified from https://unix.stackexchange.com/a/203854 and man rsync