Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crontab help

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
Hi. I am running Red Hat 7 and want to run Webalizer every day at 12:05 am. Here is my crontab:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

# sysstat
0 * * * 0,6 /usr/lib/sa/sa1 600 6 &
5 19 * * * /usr/lib/sa/sa2 -A &

# webalizer (run every day at 12:05 am)
5 0 * * * /usr/src/webalizer/webalizer -c /etc/webalizer_domain1.conf
5 0 * * * /usr/src/webalizer/webalizer -c /etc/webalizer_domain2.conf

My paths are correct and my lines do not wrap. So far, I have to manually run Webalizer...

Thanks.
 
Hi,

Looks OK except it doesn't have a '&' at the end of the command (i.e to run process in background). I can't check right now but if you installed from the Redhat powertools rpm --> ftp://rpmfind.net/linux/redhat/7.0/en/powertools/i386/RedHat/RPMS/webalizer-1.30_04-6.i386.rpm there would be an example cron file in /etc/cron.daily/webalizer.cron . You could check that to see if there is any difference on the syntax.

Other than that, the obvious thing would be to look at the logs, i.e. /var/log/cron, /var/log/cron.1, etc.

Also, I assume you do have the crond daemon running - Redhat also has something called anacron and that uses /etc/anacrontab . Check if they are activated by :

/sbin/chkconfig --list | grep cron

Regards


Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top