We use restic on a set of Windows servers, running daily automatic updates using
Since the release of
0.15, the previous version (on all servers) stopped working.
restic self-update --output restic-next.exe and it suddenly fails everywhere with:
writing restic to C:\Path\To\Restic\restic-next.exe
find latest release of restic at GitHub
latest version is 0.15.0
GPG signature verification succeeded
Fatal: unable to update restic: unable to rename target file: rename C:\Path\To\Restic\restic-next.exe C:\Path\To\Restic\restic-next.exe.bak: The system cannot find the file specified.
Any help hightly appreciated.
I can constanly reproduce it even locally on my Windows 10 machine:
Create an empty folder and fetch 14.0:
curl -Ls --output restic.zip https://github.com/restic/restic/releases/download/v0.14.0/restic_0.14.0_windows_amd64.zip
restic self-update --output restic-next.exe
Note: it working using 12.1. So do the same as above, but download 12.1 instead, and everything works. So combo
14.0 upgrading to
15.0 seem to be the problem.
i can reproduce.
after the failure, there is a new file in dir named
cmd /c restic3666372939 version
restic 0.15.0 compiled with go1.19.5 on windows/amd64
As a workaround you could create an empty file with name
restic self-upgrade --output restic-next.exe should work.
restic3666372939 file will work after renaming it to restic.exe. It is only the final rename operation which is missing.
Should be fixed self-upgrade: Fix handling of `--output` on windows by MichaelEischer · Pull Request #4163 · restic/restic · GitHub
Thanks @MichaelEischer for the help.
The suggested workaround worked when I tested it. We can adopt that I think.
I comes with a side-effect that it leaves a
restic-next.exe.bak behind (a copy of the dummy file), but it’s not a real problem.