I'm trying to run a batch script, that copies files from the local Windows server to a remote Linux server (utilising rsync and Cygwin), as a scheduled task.
If I run the batch script manually as an admin (Run as administrator) the batch script executes successfully, and the target files are copied to the remote server.
If I run the batch script manually, without elevated privileges, only part of the batch script runs. The rsync part of the batch script fails.
So, I've setup a scheduled task. The user is a member of the Domain Admins group, and the task also has the "Run with highest privileges" option checked.
However, when I run the task through Scheduled Tasks it achieves the same as when I run the batch script manually without admin privileges but I can't figure out why.
What does Scheduled Tasks do to the User that might stop the rsync part of the batch script from executing?
To add clarification, all resources that the script utilises are local except for the remote server. The remote server is specified in the rsync command as an IP address: username@ipaddress:/remotedirectory/
Additionally, I should explain that because rsync is running as part of Cygwin the local drives are referenced as /cygdrive/d/directory/ etc. Is it possible that Scheduled Tasks is having difficulty interpreting those directories?