How to copy repositories with rsync?

I really don’t have a lot of time to solve this problem, and trying to make sense of the rsync options is turning into an all-day-or-more project. There has to be an easier way…like ask here (!)…

I simply want to make a copy of my backup HD to another HD, which then gets stored off-site - the beginning of my implementation of the 1-2-3 backup strategy. From another thread here I got the following rsync command, and it works fine, except it does NOT remove repository files on the target drive which do not exist on the source drive. The result is eventually a filled-up target drive.

rsync --delete --delete-after -a {source} {target}

What do I need to change to get rsync to remove repositories from target which are not on source?

If it fills the destination disk and fails, it might not be executing the deletions maybe?

--delete-after says “after all sync operations are done, execute the deletions”. So if you have a limited size, you can try --delete-during or even --delete-before, depending on how much you trust the health of the files on the source.

That certainly appears to be the case.

I do trust my source files because before copying from backup set 1 to 2 I always do a " check --read-data" run on them.

I’ll try your suggestions, and report back. Thank you for your helpful response.

Problem solved, and I misunderstood it from the beginning. I had split a former repository into 3 smaller parts, but left a copy of the former version on backup copy HD for safekeeping, not realizing that on a 500GiB drive this was risking storage overflow, which is exactly what happened. Restic was NOT failing to delete as instructed. My memory had artfully deleted what I’d earlier done, and why. Hmmm…

Thanks again for your response. It got me to to look closer at the media…until the problem was clear.