Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C3D0AAE.80306@Salira.com> Date: Wed, 09 Jan 2002 19:29:50 -0800 From: Andrew DeFaria Organization: Salira Optical Networks User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: "Larry Hall (RFK Partners, Inc)" CC: cygwin AT cygwin DOT com, Andrew DeFaria Subject: Re: Setting up user mode cron References: <4 DOT 3 DOT 1 DOT 2 DOT 20020109172348 DOT 0206d4f0 AT pop DOT ma DOT ultranet DOT com> <4 DOT 3 DOT 1 DOT 2 DOT 20020109191148 DOT 020bf590 AT pop DOT ma DOT ultranet DOT com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Jan 2002 03:29:50.0604 (UTC) FILETIME=[0FB1F4C0:01C19987] Larry Hall (RFK Partners, Inc) wrote: >OK, yes all your mounts are system. Looking back over your original comments, what doesn't work again? You seem to indicate that cron is running. The output you show indicates it did run. But you claim it didn't run a script. How did you determine that? Perhaps you're interpreting the fact that you're having problems accessing the network share as a cron script execution problem? > OK let's scale back a little bit. The situation is that I would like to run cron on my desktop and by extension allow my users to run their own crons on their desktop. We're in a domain and as such we have set it up such that people's home directories are mounted on /home from the Windows server that houses the home directories. Therefore we have the following mount: \\sonscentral\users on /home type system (textmode). Given my username, adefaria, therefore ls /home/adefaria (or ls ~) will list the contents of \\sonscentral\users\adefaria. Note there are no mapped drives here, just UNC names. So when I set up cron I expect that when a cronjob is running for me (adefaria) that I am in /home/adefaria (effectively on \\sonscentral\users\adefarai) and I'm running as the user adefaria. And I am. As my cronjobs told me I am adefaria and my CWD is /home/adefaria. Problem is that if I do an ls (outputting to /tmp/cron.log) I see nothing. Further more if I execute foo where foo is /home/adefaria/foo and let's say foo does merely an echo "Foo executed on $(date)" >> /tmp/cron.log I do not see /tmp/cron.log updated with that echo. Instead I get email saying "foo: not found". I also tried /home/adefaria/foo as well as //sonscentral/users/adefaria/foo (got email saying /home/adefaria/foo not found, etc). Moving foo to /tmp/foo works however changing the echo to attempt to write ~/cron.log reveals permission denied when trying to write to that file. Ah ha! Getting somewhere. Apparently cron cannot deal with a network place be it a mapped drive of a Cygwin mounted UNC path. >>>>Executing this script from the command line yeilds: >>>> >>>>$ /tmp/update_view defaria >>>>update_view: Warning: View pname does not exist: defaria >>>> >>>>View pnames should be UNC names that lead to the top of the view >>>>For example: //sons-clearcase/Views/ >>>> >>>I believe you need to alter the permissions of the 'SYSTEM' account so that it can access the network. >>> >>What "network" am I accessing when I try to run /tmp/update_view? It's my >> > >Good question. Using your example above, //sons-clearcase/Views/. That's what I'm assuming lacking any other information from you. > Well that would be the parameter for the script update_view. IOW is should read something like $ /tmp/update_view //sons-clearcase/Views/defaria Otherwise the script will just echo out the error message you see. Found out that my /tmp/update_view lacked execute bits and that was why cron couldn't "find" it. Turning on the execute bits makes it run however, like we've seen here, any references to network areas causes problems. Anybody know why cron can't deal with network locations? >> understanding that /tmp is local. Of course my home directory is on the network. Is that what you mean? Anyhow, how do I alter the permissions of >> >Assuming you're trying to access your home directory in your script, yes. > Yes, apparently cron is running the job as me but this "me" doesn't have permissions to access network stuff. >> "SYSTEM" account so that it can access the network. What I have in my /etc/passwd is: >> >>$ grep -i system /etc/passwd >>SYSTEM:*:18:18:,S-1-5-18:: >> >>>I might be wrong on this. Check the email archives for similar discussions on cron. This *has* come up before. >>> >>I had checked and read a lot about cron in the archives before this. I didn't see anything that explained it. I saw stuff saying that cron cannot access network drives. Does this also mean that cron cannot access network mount points say like when you mount /mnt/share ///? Does it main you cannot then run /mnt/share/myscript? >> > >Yep, network drives are a no-no. If this is how you're trying to access the network, then that's your problem. Try using the UNC paths directly. If that doesn't work, I can only point you to the mail archives. I remember this being discussed and my recollection is the solution was 'use UNC paths'. But my memory could be wrong. Perhaps someone else's memory is clearer on this subject. > Sorry, I didn't equate a, say Z Drive accessed through /cygdrive/z as the same thing as a mount /mnt/sharedscripts ///