Are local and SFTP repositories guaranteed compatible?

I’m currently using Restic to backup to a cloud storage solution but I was considering also backing up to my own system (via the SFTP backend). I was wondering if it was possible to use the SFTP repo data directory as a local repo as well. For example on the storage device I may want to back up (other) data to the same repo or I may want to push the snapshots in the repo to cloud storage (IIUC it would be better to do this from the local host rather than restic copy on a remote device).

So I was wondering is it “supported” to use the same directory as an SFTP repo from remote devices and as a local repo from the local device? I understand that different remotes have different layouts and locking so this isn’t guaranteed in general and reading discussions it seems like this does work in practice for this combination. But I was wondering if this is supported/intentional or if I should do something else (like loopback SSH into the local machine or just use a non-restic tool to backup the cloud storage).

If this is officially supported it would be nice to add to the docs that these two repository formats are compatible.

Welcome back!

Short answer: yes, it’s the same format, on purpose. In the beginning, we had different formats for local/sftp and e.g. s3, but made restic read both (and also convert s3 repos to the new format). You can find this in the design document.

2 Likes