How to restore a snapshot to the original backup source

hello, thanks,

sorry for such a basic question, but could not find the answer in the docs and around the internet.
i did find

  1. i backup /home/username/dir to restic.
  2. the contents of /home/username/dir becomes corrupted
    — human erorr
    — ransomware
    — whatever
  3. now i want /home/username/dir to revert back in time to one of the snapshots.

hope i explained well, thanks


Restore command needs a --target parameter, just find your snapshot from the “safe” time (via restic snapshots) and use that snapshot id to restore into that place like restic restore $snapshotid --target /home/username. Optionally wipe/move dir to somewhere else before…


did a quick test, and not working, as the operation is a simple copy/overwrite.
i am looking for a sync/mirror from snapshot to source dir.
that way
— do not need extra free hard drive free space.
— quick and easy way to recover.

i guess i am looking for what veeam does, pick a snapshot and the source will be a mirror of the snapshot.
strange, restic cannot do this yet or is there a way?

i have read that some are using rsync, i guess i will have to learn that.

  1. restic restore $snapshotid /tmp/snapshot
  2. rsync /tmp/snapshot /path/to/source

Sorry for the advertisement of rustic, but it supports rustic restore --delete $snapshotid:/path/to/source /path/to/source which should do what you want.

For restic, have a look at the following open issues:

1 Like