resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

paths with spaces not quoted in Task Scheduler task on Windows

Open HertogArjan opened this issue 2 years ago • 1 comments

I am running the latest version of resticprofile (0.23.0).

I was trying to figure out why the task in Task Scheduler generated by resticprofile kept failing. It turns out the paths to a config file and a log file in the command arguments of the task contained spaces and were not quoted. Adding the quotes manually fixed the issue.

This occurs both for the 'backup' and 'check' task.

The arguments generated for the backup task were:

--no-ansi --config C:\Users\<my username with spaces>\AppData\Roaming\resticprofile\profiles.yaml --name default --log C:\Users\<my username with spaces>\AppData\Roaming\resticprofile\default-backup.log backup

while they should have been:

--no-ansi --config "C:\Users\<my username with spaces>\AppData\Roaming\resticprofile\profiles.yaml" --name default --log "C:\Users\<my username with spaces>\AppData\Roaming\resticprofile\default-backup.log" backup

HertogArjan avatar Aug 30 '23 22:08 HertogArjan

You're right, the path is not escaped.

At the same time I also noticed it's not escaped when trying to elevate resticprofile to admin privileges.

creativeprojects avatar Sep 30 '23 18:09 creativeprojects