Re: cron mystery

2007-02-26 Thread Chuck Swiger

Robin Becker wrote:
[ ... ]

before
##
SHELL=/bin/sh
MAILTO=user

13 3 * * *  $HOME/bin/daily
19 * * * *  $HOME/bin/hourly


after
##
SHELL=/bin/sh
MAILTO=user

13 3 * * *  /home/user/bin/daily
41 * * * *  /home/user/bin/hourly


and at 41 past the hour the hourly job came back.

Is it the HOME variable or the act of rewriting? User did have home 
defined in /etc/passwd.


I suspect that $HOME isn't being defined as one might expect-- cron provides a 
very minimal shell environment for scripts it runs.


--
-Chuck
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: cron mystery

2007-02-26 Thread Robin Becker

Chuck Swiger wrote:

Robin Becker wrote:
[ ... ]

before
##
SHELL=/bin/sh
MAILTO=user

13 3 * * *  $HOME/bin/daily
19 * * * *  $HOME/bin/hourly


after
##
SHELL=/bin/sh
MAILTO=user

13 3 * * *  /home/user/bin/daily
41 * * * *  /home/user/bin/hourly


and at 41 past the hour the hourly job came back.

Is it the HOME variable or the act of rewriting? User did have home 
defined in /etc/passwd.


I suspect that $HOME isn't being defined as one might expect-- cron 
provides a very minimal shell environment for scripts it runs.


except that I have exactly the same script running on another box with the same 
freeBSD version and that runs things fine. Looking in man 5 crontab seems to 
suggest that SHELL=/bin/sh  HOME, LOGNAME are set from the user passwd entry.

--
Robin Becker
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: cron mystery

2007-02-26 Thread Derek Ragona
Environment variables are set first by the users shell which then is used 
to exec cron jobs.  Basically, always take nothing in the environment for 
granted.


-Derek


At 10:19 AM 2/26/2007, Robin Becker wrote:
Can anyone think of something that can stop cron working for a particular 
user?
I just noticed on one of our 6.1 machines the crontab for a particular 
user wasn't run properly since dec 21. There were hourly and daily jobs, 
but neither seemed to be running.


Looked in var/cron and see no deny or allow files. The user x had an 
proper crontab.


In the end I modified the users crontab and rewrote it

before
##
SHELL=/bin/sh
MAILTO=user

13 3 * * *  $HOME/bin/daily
19 * * * *  $HOME/bin/hourly


after
##
SHELL=/bin/sh
MAILTO=user

13 3 * * *  /home/user/bin/daily
41 * * * *  /home/user/bin/hourly


and at 41 past the hour the hourly job came back.

Is it the HOME variable or the act of rewriting? User did have home 
defined in /etc/passwd.

--
Robin Becker
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]