Removing the --use-fs-snapshot flag causes the issue to disappear:
PS C:\Users> restic --repo C:\restic_repo backup C:\Morrowind
enter password for repository: signal interrupt received, cleaning up
Weirdly, I’ve found adding the --verbose flag also fixes the problem:
PS C:\Users> restic --use-fs-snapshot --verbose --repo C:\restic_repo backup C:\Morrowind
open repository
enter password for repository:
signal interrupt received, cleaning up
I also noticed that moving the --repo flag after the --use-fs-snapshot flag causes restic to print an error about the repo path instead of the backup path.
This seems to affect 0.11.0 as well as the latest beta release:
The --use-fs-snapshot option is on the backup command, it’s not a global option for restic in general. So try moving the --use-fs-snapshot part to right after the backup command, and it may work just fine.
Just for reference, if you run restic help you will not see the --use-fs-snapshot option, but when you run restic help backup you will.
Ah, that makes perfect sense. I moved the --use-fs-snapshot option to after backup as you said and it’s working fine now, thanks!
PS C:\Users> restic --repo C:\restic_repo backup C:\Morrowind --use-fs-snapshot
enter password for repository: signal interrupt received, cleaning up
It seems that weird --verbose behaviour has kept my backup script functioning for the last ~5 months despite the --use-fs-snapshot option being in the wrong place
The only reason I noticed something was up was because restic v0.12.0 no longer allows the use of both --verbose and -q together, so I removed --verbose and everything stopped working.
What we’re seeing here is a kind of a hen and egg problem: the --use-fs-snapshot option only exists for the backup command, which makes it a problem to specify it before backup in the command line. Another complicating fact is that command-line options can either be a single flag like --use-fs-snapshot or take a parameter like --parent snapshot. restic uses cobra for the command line handling, which when it parses restic --use-fs-snapshot backup ... now faces the unknown option --use-fs-snapshot. Or is it --use-fs-snapshot backup? Cobra seems to assume the later variant, at least as long as it tries to find the command name.
And that provides the explanation for the initial problem: restic --repo C:\restic_repo --use-fs-snapshot backup C:\Morrowind is parsed as options --repo C:\restic_repo and --use-fs-snapshot backup making C:\Morrowind the first non-option parameter.
Adding --verbose into the mix accidentally fixes the problem: restic --repo C:\restic_repo --use-fs-snapshot --verbose backup C:\Morrowind now parses into options --repo C:\restic_repo and --use-fs-snapshot --verbose and backup as command name. Now that cobra knows the correct command it seems to parse the command line arguments again and arrives at the expected --repo C:\restic_repo, --use-fs-snapshot and --verbose.