Using the same backup on multiple machines

Could you share your advice on how to use restic in the following scenario?

I have multiple machines. I need to use the same files/folders on those machines, change them, and backup.

If I understand correctly, restic creates hast-based backups in the same repository. But what I need is a repository that is not associated with any of the hosts so that they all can use it as if every one of them was an “owner” of the repository.

Is there a way to achieve that?

There is no “owner” of a repository. A repository is a restic-specific set of files and metadata for the purpose of storing your backups of other systems.This can be hosted in various places and the restic clients send backups to it, generally speaking.

Every restic client that knows the password to one of the keys in the repository (initially just one such key) can access the entire repository. So if you e.g. have five different systems backing up to the same repository, they are all equal and noone is more eligible or have more access than the others. They can all send backups to the repository and read the backups that are in the repository - both the ones they sent themselves and the ones that other systems sent.

That said, are you really looking for a backup software, or are you instead looking for a way to synchronize files between your systems?

If you are not looking for a synchronization utility (such as Seafile or Syncthing), and i.e. have the synchronization of your files between the systems in place already, then you can indeed use restic to back up all of these systems.

If all of them have the files e.g. in /data/foo you can just back up /data/foo on each of the systems. They will all only send changed data that has not already been stored in the repository (thanks to deduplication), so you won’t have to save redundant data in the repository.

You can use restic key add to add additional keys to the repository (for the additional systems), after first initializing the repository and completing a first backup run on one of the systems that has the files on it.

Thank you for the explanation!

Now it’s clear to me that sync and backup should be separated.

What about the following scenario:

I backed up /home/user1 on laptop1. Then laptop1 is not accessible/usable for any reason and I switched to laptop2 permanently.
If I understand correctly, I should:

  1. restore the backup to some place, e.g. /home/user2/tmp
  2. move all files I need from /home/user2/tmp to /home/user2 where I need them
  3. backup moved files from the step (2)

Is my understanding of the process correct?

Yeah, that would work fine. Although it’s not necessary to run another backup until you actually changed some files after having restored (and moved) them, of course :slight_smile:

I would personally do what you wrote - restore all of my home dir stuff to a temporary folder, and then move it. I would probably skip a few files because of general cleaning when I have the chance :wink:

Thank you again for helping with that!