resticprofile
resticprofile copied to clipboard
paths with spaces not quoted in Task Scheduler task on Windows
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
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.