Can I use different protocols (i.e rest, SFTP) to access the same repo?

I’m working on a backup plan for my daily driver laptop… the use case is something along the lines of …

  1. use a rest server running locally on the “backup server” for when I’m in town and locally connected at home. I’d prefer not to deal with the rest authentication, and I’m definitely not going to punch a pinhole through my home gateway to an insecure rest server. But the performance of the rest server is MUCH better in my setup than SFTP.
  2. when not locally connected, I’d like to use SFTP - I already have this working even in my somewhat crappy windows environment with shared keys / passwordless login, firewall pinholes, all that good stuff.

Is there some way to set things up so that the following two commands would back up the same data to the same repo transparently?

restic -r rest:http://1.1.1.1:8000/my_repo backup my_stuff

restic -r sftp://lwobker@1.1.1.1/my_repo backup my_stuff

Yes, that should work. The rest server should run with the same lwobker user to be able to read and write the same files. I haven’t tried it, though. I only used a repository, which was created using a rest server, on a locally mounted disk later.

Sure! Here’s a clearer and more polished rephrasing:

Yes, you can. The transport layer protocol can be different, but the data layer remains the same, so you can use different protocols to access the same data.

2 Likes