Use restic copy to also delete snapshots on target

Hi,

I am currently running multiple source VMs which are backing up to a single different VM via sftp.
Works great so far, but I thought about more redundancy in case my backup VM goes down, so I would like to copy all repositories to a second VM in a different region.

I saw that restic copy is capable to transfer snapshots efficiently between repositories: Working with repositories — restic 0.15.1 documentation

But when I delete a snapshot in the source repo, it will not be deleted on the target repo via restic copy.

Do I need to do independent restic forget and restic prune commands on all repositories or is there are more elegant way of just syncing the repos?

Probably rsync would also work, but I thought using a copy tool which is aware of the restic repository format is probably a better idea, especially, if a backup might be currently running.

Repositories don’t store which snapshots were deleted. Thus copy has no notion of removed snapshots and therefore can’t sync snapshot removals.

Even if there was such a functionality, you’d still have to explicitly run prune for both repositories.

1 Like

Ok, I’ll just run the same forget and prune commands on both repos in that case.

Thanks for your help and clarification :slight_smile: