, 1 min read
Force rsync Not To Use Timestamps
Most common usage of rsync
is
rsync -anv ./ user@remote:/dir/
But when the timestamps of the files on source and target vary wildly it is better to use:
rsync -crntlv ./ user@remote:/dir/
The option -c
stands for checksum. The option -n
is used to not overwrite anything (dry run). Drop -n
to actually run the command.
Option -t
to preserve modification times, -r
to recursively scan subdirectories, -l
for symbolic links, -v
for verbose output.
I don't use -p
to preserve permissions, but rather let the target system decide how to create files, and leave previous permissions intact.