I like this part
This not so much sorry about the confusing interface.
You can specify the parameters in the sftp.command
option, but it’s much easier to define a new host (alias) in the ~/.ssh/config
file. That’s described in the manual. In your case this would be something similar to:
Host storagebox
Hostname your-storagebox.tld
Port 23
User u12345
IdentityFile /path/to/.ssh/id_ed25519
Then you can just use restic -r sftp:storagebox:/path/to/repo
and don’t have to fiddle around with options to ssh
. If it isn’t possible to use the /root/.ssh/config
file, you can maybe use /etc/ssh/ssh_config
. Otherwise it’s also possible to pass the path to the config file to ssh
like this:
$ restic -o sftp.command="ssh -F /path/to/config storagebox -s sftp" sftp:doesnotmatter:/path/to/repo
So, back to the issue you describe: I find it very odd that you needed to pass a different path, it should always be the same (paths are interpreted only on the target server, so they are independent of the client). Once you have created a config file, you can easily check with sftp
what the paths are:
$ sftp storagebox
Connected to storagebox.
sftp> ls /backups/server12345/config
[...]
sftp> ls backups/server12345/config
[...]
Can you do that and report back if there is any difference? Usually (depending on the what the sftp server is), relative paths are relative to the user’s home directory on the server.
I’m curious: can you tell us which provider/service that is? It sounds like it may be Hetzner, they have an offer called “storage box”. If so, your findings may be helpful to others searching the forum for the provider’s name
Thanks for asking these questions, that’s exactly what the forum is for.