rsync is a unix command line tool for syncing two folders. It can sync locally or over the network using SSH.
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
--archiveArchive mode (Do the sync preserving all filesystem attributes)
--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
--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