Using restic to sync the same folder on two computers

My understanding is this is not the intended use-case for restic.

Could I just pair syncthing with restic running on only one of the two hosts that have the folder?

Would anything weird happen if I ran restic on both hosts, pushing backups to the same restic repo? And both folders kept in sync using syncthing

1 Like

Lets call the folder in question “code dir”. its a folder with all the code i’m working on. Here’s what I’ve done so far:

host1: created daily cron backups of code dir.
host2: restored from restic backup a copy of “code dir”.

From this point, i could start using syncthing to keep them in sync, I assume? just not sure how to also keep using restic to save a backup and point-in-time snapshots.

1 Like

There are a few things I don’t quite understand. You want to back your code up, sync the backup and then restore on the second host so you can work with the code there? That sounds a little complicated.

For “point-in-time snapshots” of code (as in “whoops I need to undo this”), git is basically the goto software these days. Maybe check that out. You can then use syncthing to directly sync git repos or even push the repo somewhere central (like to codeberg, github or just to your own server via ssh) and then pull changes to the second host if you need them there.

And then, in addition, use restic to backup everything to a different drive or location in case host1 or host2 die and you need to restore them.

But that’s just my five cents!

1 Like

They shouldn’t care about each other, so I don’t see why this wouldn’t work.

No, you can have multiple restic clients backing up to the same repository at the same time.

1 Like

Ok, thank you. syncthing seems to be working great. I think I will keep restic going on only one host, and just sync changes to that host for being backed up by restic. I’ll probably expand on this pattern and keep a copy of everything on a NAS kept up to date by syncthing, and then on the NAS restic keeps everything backed up.

2 Likes

this is my $HOME/code dir, not an individual git repo.

Quis custodiet ipsos custodes? / Who backs up the backups? Github is a SPOF

this keeps everything backed up in restic, including all git repos because git is decentralized, as well as any work in progress state, un-pushed branches, etc. making it much easier to pick up where i left off across multiple devices.

1 Like

Got it now! Sorry for the basic talk :crazy_face:

1 Like