I am using a bash wrapper script around
rsync so I run with
--dry-run option and then grep on it's output to check for "deleting", so I can make sure I am not losing data by some mistake. (I have not been able to find deleted files on the log output via
--log-file but that's a separate question).
However, even if I am taking this extra safety step, I have still been able to mess up. I accidentally swapped the usual source and destination folders on the rsync command, and some files NOT present on destination folder where deleted from the source folder. I indeed saw the files being marked as deleted on the wrapper script output, but I missed the mistake because the path names are relative, and I assumed they were at the other (usually destination) end
I tried with
--relative option to rsync as suggested in a similar question below, but it does not have the desired effect.
(I am creating a new question as I do not have yet the reputation to comment on that one, and I do not think I should be asking on an answer, please correct me if I am wrong)
Any idea on how I can achieve this via some
rsync command line option?