How to: Retrieve A File From a Snapshot

~ = home
/ = root
Got it 100%

No worries, appreciate the father Crom in you.

you’ll probably want to exclude certain directories, there’s a lot of files that aren’t relevant to back up at all, e.g. some runtime and system files

10-4 I am seeing that now. ETA 17 hours to do a backup, total size 128 TiB, all 12 cores on my cpu are at capacity so I will stop it and back up my main software and /var/www for all webcontent. Then if I ever edit a configuration file or something I will back up just that file.

Thanks again, you helped me on my other thread a while back too. Much appreciated.

Note that you also probably want to add --one-file-system to your backup command.

Linux has a number of virtual filesystems that you DO NOT want to back up (such as /proc and /sys, and even /dev on modern distros). This calls back to what @rawtaz said about learning the basics of your system. You don’t actually want to back up everything visible from / since some of that stuff doesn’t actually exist on disk.

In particular, if you happen to have a removable USB drive mounted when the backup runs, the backup will also grab the contents of that drive.

--one-file-system prevents restic backup from “crossing filesystem boundaries” which means it will stay only within the filesystems explicitly listed as arguments. If / is the only storage volume in your system, then restic backup -r ... --one-file-system / will work. But if you have e.g. /home as a separate volume, then you would need to list both (/ /home) on the command line.

There is no one-size-fits-all answer here. You need to know your own system.

No, you don’t want to back up “just that file.” After restic backup has finished backing up this mountain of data, future runs will only back up chunks of files that changed and you should see follow-up backups complete very quickly.

If you back up only files that changed by hand, then you will not have a complete snapshot of everything anymore. If your disk suddenly dies and you want to restore everything from a backup, you’ll have to restore multiple backups in pieces to restore the system. Letting restic take complete snapshots (with its deduplication) should be pretty quick and gives you a single snapshot of the entire state of the system. (The snapshot will just share a lot of data with the prior snapshot.)

1 Like

Just for info: This is now included in the beta builds.
@cdhowie: Would you mind trying the latest beta with your large repositories?

IMO the restic mount command is very useful for various situations and I think it is especially a nice tool for people who are not that confident using the console…

1 Like