Battle tested file synchronisation.

rsync stands for remote sync and is a remote and local file synchronisation program.

I used it for syncing nchrs with the webserver and in a lot of my bash scripts.

Usage

 rsync $source $destination

Options

a - archive/preserve permissions/recurse
v - verbose output (doesn't work with --info=progress2)
t - preserve modification time
u - update (skip files newer on the receiver)
P - show file progress
n - dry run
h - human readable file sizes
z - compression during transfer
r - recurse into directories

Includes & Excludes

To include or exclude files, use the appropriate flags. Rsync does not parse comma separated values in the include & exclude flags. They must be listed individually. Include won't overwrite excludes, so make sure to list them first:

 rsync -a --include='.htaccess' --include='.htpasswd' --exclude='.*' --exclude='.txt'

Make sure to quote variables ("$source" "$remote") to avoid issues with spaces or special characters.

incoming(5) | memoir | meta | software | photography | ssh