<div dir="ltr"><div dir="ltr" style="font-family:Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif"><div>Greetings,</div><div><br></div><div>I have written a C program that runs on Windows servers and does overhead and reporting for backup administration.  The program calls rsync for the actual data copy function.  It copies data from a remote system to a local drive and that works fine.  However, I have recently made changes to copy the data to a mapped drive on a NAS device instead of the local drive.  </div><div><br></div><div>The changes work fine when run from a command line, but fail when run from a scheduled task or cron job:</div><div>    rsync: mkdir "/cygdrive/q/restores" failed: No such file or directory (2)<br>    rsync error: error in file IO (code 11) at main.c(675) [Receiver=3.1.2]<br></div><div>Note:  The folder already exists and permissions are open for Administrator.</div><div><br></div><div>Command line that works is bash command to call the C program under Administrator login.</div><div>Scheduled task built as Administrator with or without highest privileges fails.</div><div>Tried Cron entry built under Administrator and it fails. </div><div><div><br class="gmail-Apple-interchange-newline">Here is the <span class="gmail-il">Rsync</span> command (abbreviated) called by the C program:</div><div><span class="gmail-il">rsync</span>  -rltgoD --chmod=Du+w,u+r,u+x -e "ssh -p 33222 -i \"/cygdrive/c/Users/administrator/.ssh/id_rsa\"" --stats --files-from=/... -vv --exclude-from=/.... <usr>@remote:/<remote_loc>  /cygdrive/q/restores <br></div><div><br></div><div>Note: q is the mapped drive to the NAS share.</div><div><br></div><div>So, what can be done to track this down?  Why would running as a scheduled task or cron job fail when command line works?  I am willing to do any kind of tracing if someone can provide directions on how to do that.</div><div><br></div><div>Thanks in advance,</div><div>Leon</div><div class="gmail-yj6qo"></div><div class="gmail-adL"><br></div></div></div></div>