I’m new to Restic, and very impressed! However, I’m currently failing to grasp one concept, despite finding other threads that touch on it. My challenge is this:
How do I restore a given path with the latest files from all snapshots?
Here’s my artificially-simple theoretical use case:
I start small, using restic to regularly back up one critical file:
# restic backup /home/user/project/foo/bar/barfile.txt
Later, I start regularly doing the same thing with a second critical file, to the same repository:
# restic backup /home/user/project/foo/foofile.txt
Then, disaster strikes, and the contents of my /home/user/project
directory are lost.
How can I use restic
to reconstruct the /home/user/project
directory in one stroke, populating it with the latest versions of all files, given that the latest versions of each file don’t live together in a single snapshot?
Do I need a wrapper script to analyze all snapshots and work this out?
I’ve used a simple case to illustrate this, but I’m naturally hoping for something that scales.
My end goal is to be able to make both regular backups of complete directory trees and also one-off backups of individual files at any time, and be able to tidily restore the union of all of the latest files under a given path.