Consider following directory structure:> mkdir -p src/empty tgt bkpwhen making an initial backup with> rsync -r src/ tgtthen the empty directory in src will be copied to tgt. However, if the directory is removed from src> rmdir src/emptyand 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.
An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20210103/15535972/attachment.htm>
On Mon, Nov 23, 2020 at 1:33 PM CRTS via rsync <rsync at lists.samba.org> wrote:> then the empty directory does end up in bkp. >You mean "does not". That is correct, as it only creates backup dirs to hold backup files. I recall this being specifically chosen as the desired outcome but not the details of why (since it was many years ago). In any case, it's unlikely to change. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20210115/a591fe66/attachment.htm>
Apparently Analagous Threads
- rsync incremental backup problem with --backup-dir switch
- DO NOT REPLY [Bug 5091] New: Incremental-recursive, list-only "rsync --delete" tries to clean out working dir
- "-b --suffix '' --delete --backup-dir /path/" combination does not act as expected
- rsync via restricted ssh command=
- [Bug 2758] New: "File exists" error using options -b and --backup-dir with device files.