Bug when using rsync -r --delete -b --backup-dir

CRTS crts at gmx.net
Mon Nov 23 21:33:35 UTC 2020


Consider following directory structure:

>  mkdir -p src/empty tgt bkp

when making an initial backup with

>  rsync -r src/ tgt

then the empty directory in src will be copied to tgt. However, if the
directory is removed from src

>  rmdir src/empty

and rsync is run like

>  rsync -r --delete -b --backup-dir=../bkp src/ tgt/

then the empty directory does end up in bkp. I am using the --backup-dir
and the --delete option to move an outdated snapshot to another directory
by backing up an empty directory. I was expecting that the entire
directory structure to be preserved. Apparently this is not the case
for empty directories.

Can this be fixed? Is this even the right place to file a bug report? I
do not have a github account to do this on github.




More information about the rsync mailing list