How to traverse SFTP path that includes colons

Hi Everyone,

I can’t find how to escape special characters in the sftp path of the restic-cli, does anyone know?

I’m backing up from a Linux machine to a Windows machine running microsoft provided OpenSSH, with an external drive (letter M:) connected to that Windows machine.

SSH (including authorized_keys) works fine, but restic’s cli seems to choke on the colon after M.

restic -r sftp:backup-server:/M:/restic_server_pc

It does seem to be a valid path in FileZilla as well as sftp so I think I’m not breaking any conventions here…


sftp> cd /
sftp> ls
C:  M:  
sftp> cd M:
sftp> ls
$RECYCLE.BIN                   System Volume Information      restic_server_pc               

Really appreciate any and all feedback!

(Note, I edited “semicolon” to “colon” in your post. ; is a semicolon. : is a colon.)

The Windows SSH server should treat absolute paths of the form /a/b as equivalent to a:\b, so you should only need to adjust your path accordingly:

restic -r sftp:backup-server:/M/restic_server_pc

Oops. Thanks for fixing that and replying!

Unfortunately my windows seems to be a little stubborn.


Which restic version do you use? Which error message do you get when using the problematic path? I’ve just tested restic 0.10.0 using a path that contains a colon (macOS to Linux) and that works perfectly fine for me.


Oh my…

Thanks for your response Michael. I’m using 0.10.0 and your test made me doubt what I was doing…

And now I feel like such a donkey. I’ve spent hours on this and it turns out restic didn’t do anything because I forgot to put init behind the restic -r command :sweat_smile:

Time to get my backups in order :sunglasses:

Sorry for wasting everyone’s time…