[UNIX-WIZ] Fixed: [UNIX-WIZ] automount under cron
The problem was the cron line was trying to run “*” instead of
report_script..
I was wondering why wasn’t getting the debugging information that
Dennis suggested, so I finally _really_ read the mail I was getting
from cron. It said “* /abc not found”. The star is the key point
here…. When I looked in cron it had minutes and 5 stars then the
script name, not minutes and 4 stars and the script name. So cron was
trying to run “*”, which would be the root directory, or in other
words, /abc. So the fact that the message looked related was pure
coincidence, because /abc happened to be the first directory in /.
It works fine now that I am actually running the script.
- Kai
On Wed, May 21, 2008 at 6:04 AM, Dennis Lovelady
wrote:
> OK. Just a thought. Only other thing I can suggest, is to do a 2>&1 on the end of the cron line, and add “set -x” to the top of the ksh script. Good luck.
>
> Dennis E. Lovelady
> Senior Manager / Capability Specialist
> AR Workforce
> Accenture
> 404-386-9745 (c) 678-657-8506 (w)
> AIM: delovelady MSN: fastcounter@lovelady.com
>
>
> —–Original Message—–
> From: Unix Wizards Mailing List [mailto:UNIX-WIZ@LISTSERV.NODAK.EDU] On Behalf Of Kai Hintze
> Sent: Tuesday, May 20, 2008 10:52 PM
> To: UNIX-WIZ@LISTSERV.NODAK.EDU
> Subject: Re: [UNIX-WIZ] automount under cron
>
> I have run it as root, yes. I understand your point about root
> and NFS. I will check the cron log.
>
> Thanks,
> Kai
>
> On Tue, May 20, 2008 at 4:19 PM, Dennis Lovelady
> wrote:
>> Hi, Kai:
>>
>> Since you are running this as root — does root have write permissions
>> to the mount point? Remember that NFS and root permissions can be a bit
>> …. shall we say “unusual?”
>>
>> When it works manually, is it working as root?
>>
>> Have you checked the audit log? I cannot recall offhand where Solaris
>> 5.8 stores that log (/var/cron/log, maybe?), but I do remember that
>> there is one, and it’s usually quite useful in cases like this.
>>
>> Dennis E. Lovelady
>>
>> —–Original Message—–
>> From: Unix Wizards Mailing List [mailto:UNIX-WIZ@LISTSERV.NODAK.EDU] On
>> Behalf Of Kai Hintze
>> Sent: Tuesday, May 20, 2008 6:13 PM
>> To: UNIX-WIZ@LISTSERV.NODAK.EDU
>> Subject: [UNIX-WIZ] automount under cron
>>
>> Greetings Wizards!
>>
>> I am scratching my head on a cron/automount conundrum. I have a script
>> that runs fine when I run it by hand but fails under cron. Usually
>> that means some environmental var is not being picked up. But what
>> environment controls automount?
>>
>> OS is Solaris 8. /abc is automounted from our central NFS server to
>> nearly all our boxes. I want to put the report output there so we can
>> see it easily.
>>
>> The script is pretty straight-forward:
>>
>> #!/usr/bin/ksh
>> # this is the report script
>>
>> Today=$(/usr/bin/date “+%Y%m%d”)
>> cd /abc
>> cd report_out
>> /usr/local/bin/report > $Today
>>
>>
>>
>> This runs in root cron at 06:15 every morning. The only output I am
>> getting though is a mail saying “/abc does not exist”.
>>
>> Why does it fail to automount? It runs fine by hand or under at (but
>> of course at keeps the environment).
>>
>> Thanks,
>> Kai
>>
>>
>
> –
> To unsubscribe from the UNIX-WIZ Mailing List, send an email to
> LISTSERV@LISTSERV.NODAK.EDU having a body containing only “SIGNOFF
> UNIX-WIZ” minus quotes of course. There are searchable archives located
> at http://listserv.nodak.edu/archives/unix-wiz.html
> ———
> ListAdmin: UNIX-WIZ-request@LISTSERV.NODAK.EDU
> Contact the above address if you have any problems or questions about the
> list itself!
>
>
>
> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
>
> –
> To unsubscribe from the UNIX-WIZ Mailing List, send an email to
> LISTSERV@LISTSERV.NODAK.EDU having a body containing only “SIGNOFF
> UNIX-WIZ” minus quotes of course. There are searchable archives located
> at http://listserv.nodak.edu/archives/unix-wiz.html
> ———
> ListAdmin: UNIX-WIZ-request@LISTSERV.NODAK.EDU
> Contact the above address if you have any problems or questions about the
> list itself!
>
–
To unsubscribe from the UNIX-WIZ Mailing List, send an email to
LISTSERV@LISTSERV.NODAK.EDU having a body containing only “SIGNOFF
UNIX-WIZ” minus quotes of course. There are searchable archives located
at http://listserv.nodak.edu/archives/unix-wiz.html
———
ListAdmin: UNIX-WIZ-request@LISTSERV.NODAK.EDU
Contact the above address if you have any problems or questions about the
list itself!