Cron

Brian Densmore DensmoreB at ctbsonline.com
Wed Oct 27 10:09:27 CDT 2004


Ok thanks everyone for the responses. 
Some questions and clarifications.

Where is the cron log? I don't see one specifically for cron.

How would I add logging to the script?

According to the way I read the crontab entry, the script should be called 
by the run-parts script as root. If this is the case then it should have
rights to write to the file.

Yes, I'm still rather new at scripting and cron.

I'm only using cat grep and awk in the script and all paths are fully
qualified. The file that the script is writing to is set up exactly
like the log files in /var/log. I had considered making it world writtable
for debugging, but that wouldn't solve my problem, because I want to lock
it down. So I guess I need to figure out "who" is running cron jobs,
although I thought it was root.

------------------------------------------------------------
/etc/crontab
# /etc/crontab: system-wide crontab                                                       
# Unlike any other crontab you don't have to run the `crontab'                            
# command to install the new version when you edit this file.                             
# This file also has a username field, that none of the other crontabs do.                
                                                                                          
SHELL=/bin/sh                                                                             
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin                         
                                                                                          
# m h dom mon dow user  command                                                           
25 6    * * *   root    test -e /usr/sbin/anacron || run-parts --report /etc/cron.daily   
47 6    * * 7   root    test -e /usr/sbin/anacron || run-parts --report /etc/cron.weekly  
52 6    1 * *   root    test -e /usr/sbin/anacron || run-parts --report /etc/cron.monthly 
#                                                                                         

----------------------------------------------------
My holding blacklist file particulars of import
rw-r--r-- root.adm /etc/illegalips.txt


> -----Original Message-----
> From: Jonathan Hutchins
> 
> May I suggest you develop some logging or error reporting 
> that shows you if 
> the script is getting called?

> -----Original Message-----
> From: Dan
>
> Just a guess, but cron doesn't know about your $PATH


> -----Original Message-----
> From: John M Geiger
>
> what is the setting in your /etc/crontab file for running daily
> jobs? I have to believe the script is being kicked off by cron but,
> as someone else has noted, may have a PATH problem or other
> environmental variable problem of some sort. 
> 
> Or, just to make sure, the ID that your blacklist script runs
> under does have permission to update the blacklist hold file, right?



More information about the Kclug mailing list