Rsync ignores dry-run

rsync

I have just run the following command in a bash script

rsync -av -update  --dry-run --delete $EX "$FROM" "$TO"

the sync ran, --dry-run was ignored (luckily that was ok this time).

Does any one see any reason why --dry-run would be ignored here?

Best Answer

That's because the correct option is --update, not -update. Your command should be:

rsync -av --update --dry-run ...

When rsync does the dry-running, the last line of default rsync stat output will show the string (DRY RUN) e.g.:

total size is 0  speedup is 0.00 (DRY RUN)

Full output:

% rsync -av --update --dry-run foobar out/
sending incremental file list
foobar

sent 62 bytes  received 19 bytes  162.00 bytes/sec
total size is 0  speedup is 0.00 (DRY RUN)
Related Question