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.
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.
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.
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.