<div dir="ltr">  Hi raf,<div><br></div><div>I was not aware the network maps were "user experience".  Thanks for your tips.  I have tried everything I can come up with, but cannot get it to work.  I figured out another solution, but thank you very much for your help.</div><div><br></div><div>Best,</div><div>Leon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 29, 2020 at 9:23 PM raf via rsync <<a href="mailto:rsync@lists.samba.org">rsync@lists.samba.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Leon Vanderploeg via rsync wrote:<br>
<br>
> Greetings,<br>
> <br>
> I have written a C program that runs on Windows servers and does overhead<br>
> and reporting for backup administration.  The program calls rsync for the<br>
> actual data copy function.  It copies data from a remote system to a local<br>
> drive and that works fine.  However, I have recently made changes to copy<br>
> the data to a mapped drive on a NAS device instead of the local drive.<br>
> <br>
> The changes work fine when run from a command line, but fail when run from<br>
> a scheduled task or cron job:<br>
>     rsync: mkdir "/cygdrive/q/restores" failed: No such file or directory<br>
> (2)<br>
>     rsync error: error in file IO (code 11) at main.c(675) [Receiver=3.1.2]<br>
> Note:  The folder already exists and permissions are open for Administrator.<br>
> <br>
> Command line that works is bash command to call the C program under<br>
> Administrator login.<br>
> Scheduled task built as Administrator with or without highest privileges<br>
> fails.<br>
> Tried Cron entry built under Administrator and it fails.<br>
> <br>
> Here is the Rsync command (abbreviated) called by the C program:<br>
> rsync  -rltgoD --chmod=Du+w,u+r,u+x -e "ssh -p 33222 -i<br>
> \"/cygdrive/c/Users/administrator/.ssh/id_rsa\"" --stats --files-from=/...<br>
> -vv --exclude-from=/.... <usr>@remote:/<remote_loc>  /cygdrive/q/restores<br>
> <br>
> Note: q is the mapped drive to the NAS share.<br>
> <br>
> So, what can be done to track this down?  Why would running as a scheduled<br>
> task or cron job fail when command line works?  I am willing to do any kind<br>
> of tracing if someone can provide directions on how to do that.<br>
> <br>
> Thanks in advance,<br>
> Leon<br>
<br>
Hi,<br>
<br>
I think the most likely reason is that when you execute<br>
the command interactively, you are logged into Windows<br>
locally and your cached credentials are used to connect<br>
to the mapped drive. But that's not the case when the<br>
task is scheduled, and so the mapped drive isn't mapped<br>
when the scheduled task is attempted.<br>
<br>
Similarly, with Cygwin, you can only see<br>
/cygdrive/q/... while you are accessing it locally. If<br>
you ssh to a Windows host with Cygwin and sshd running,<br>
you can't see any mapped drives that are accessible to<br>
the local user, even if you ssh in as the same user.<br>
<br>
You will have to map the drive in the scheduled task<br>
before invoking rsync, and then unmap the drive<br>
afterwards. I don't know how to do that or handle the<br>
credentials that would be needed, but I think that's<br>
where to look.<br>
<br>
cheers,<br>
raf<br>
<br>
<br>
-- <br>
Please use reply-all for most replies to avoid omitting the mailing list.<br>
To unsubscribe or change options: <a href="https://lists.samba.org/mailman/listinfo/rsync" rel="noreferrer" target="_blank">https://lists.samba.org/mailman/listinfo/rsync</a><br>
Before posting, read: <a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="noreferrer" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
</blockquote></div>