I’ve been struggling to get Restic running on Windows, using the Task Scheduler to automatically run periodic backups, but so far without luck. It looks like others have backups running on Windows, presumably also using some kind of scheduler. Can you share how you set this up?
Here’s what I’ve ran into so far:
- Running a backup manually from the terminal seems to work with an SFTP target (openssh was previously installed, I suspect it is using that). I haven’t run a full backup yet, and I get a ton of “in use” errors, AFAIU this would need a VSS snapshot to work. I found a [powershell script] (http:github.com/restic/restic/issues/340#issuecomment-307636386) for this, and the [DiskShadow script interpreter] (https:docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc772172(v%3dws.11)) also looks promising. I remember reading about a utility that (looked like it) offers a single binary to wrap a backup run (e.g. call
vsssomething.exe restic backup ...). I can’t quite find it anymore, though.
- Creating a task that should run restic as the SYSTEM user would, when manually triggered from the commandline, do nothing at all. After figuring out how to enable task history (in the right panel of the main Task Scheduler window), I could see a small log in the task properties window. This showed a failure, without any useful error message.
- I found this post suggesting that the scheduler would only work for users with the “Log On As Batch Job” group policy permission. Switching to a newly created “Restic” user added to the “Backup Operators” group (which seemed appropriate and has this permission) removed the error, but still nothing happened. If this is really required, why did the error message not tell me (or even more, why did the GUI not tell me when I selected the user?)…
- I could not figure out how to get log output from a background task. I tried wrapping restic in a cmd script that redirects to a logfile and run that instead, but I could not get the log file to appear when run from the task scheduler (worked fine running manually). There might be permission problems here, even though I think I had the permissions ok.
- I put the restic binary, as well as the cache, SSH key and password file in
C:\Program Files\Restic, which seemed to make sense. I’ve struggled with permissions on that directory, though. At one point the “Effective permissions” GUI said my “Restic” user had Full Control, but a terminal running as that user (started with
runas /user:Restic cmd) could not create a file in that directory. I now wonder if this was related to UAC (running in low privilege mode) or something.
- I’ve fiddled with the “Run with highest privileges” checkbox a bit. It seemed good to have that turned on, but I switched it off when things were not working (thinking it might not succeed in getting more privileges). I’ve later learned that this checkbox is applicable to regular users with admin access and matches the “Run as administrator” GUI element you normally have. See this post. Now, I think this checkbox should just be checked, I do not think it will hurt if it does not apply.
- I’ve got no idea where to start debugging when the “history” tab shows no errors, but things are not working. I’m even wondering if the builtin Task Scheduler is even the right tool here?
So, I’m wondering how other have set this up. I’m usually more of a Linux guy (settings this up on Windows for a friend), so I’m also interested in best practices wrt file locations, permissions, etc.
(some links in this post are intentionally broken, since new users can only post 2 links…)