job fails when run as task.

Get help for specific problems
Posts: 6
Joined: 15 Apr 2023

decoffey

This backup job is set to run a 02:00. The user is logged in but the screen is locked. If I run this manually everything is fine, no errors. When run out of the task scheduler this job fails with the unable to log in message. See attachment.

I have validated that the user id on the Windows machine is the same as the user on the NAS, also both have the same password.
Attachments
Nightly_Batch_Run 2023-08-31 063534.234 [Error].html
(6.11 KiB) Downloaded 253 times
Posts: 1202
Joined: 8 May 2006

therube

I'm thinking it's a "task scheduler" related issue.
In that when running "task scheduler", you are not "you", task scheduler is using its' own credentials.
So you, logged in with your password, is fine. But task scheduler is not using your credentials, so does not know that you've logged in.

(And I'm sure there's a simple fix - which I don't know?)
It might be the same as this:
https://freefilesync.org/faq.php#task-scheduler-network.

See also:
https://freefilesync.org/manual.php?topic=schedule-batch-jobs#windows

viewtopic.php?t=8850
Posts: 6
Joined: 15 Apr 2023

decoffey

I was just looking at the links above. I have my job set to run under highest privileges'. I'm gonna undo that and see what happens this evening.

LeoW

I was just looking at the links above. I have my job set to run under highest privileges'. I'm gonna undo that and see what happens this evening. decoffey, 01 Sep 2023, 19:18
This should cure your problem.
Posts: 6
Joined: 15 Apr 2023

decoffey

Undoing the "run under highest privileges" has me back to the original issue. See attachment.

The script runs fine when invoked as a foreground task, fails when invoked by the task scheduler. The entry in the scheduler was created to run under the user who created the entry. In the app the connections are UNC, the connections to the folders on the NAS are set to persistent. And the user has admin rights on the Windows machine and on the NAS. And the user id and passwords are the same on Windows and the NAS.

What am I missing that causes the script to fail when running out of the scheduler?

LeoW

I would need to try and replicate your scenario and see if I can come up with a solution that works.

I'll try and do this in the next couple of days. I don't have a NAS to test with, so no UNC paths.

I will be testing a connection to a remote machine via Rclone software. You should try this too. It may resolve your problem. You can set a mount point without having to worry about UNC paths. The Mount Point on windows can be either a drive letter or a folder pointing to the NAS.