|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Crontab not working
I am running FreeBSD 6.3 STABLE.
Everything seems to running fine however a while back my cacti scripts stopped working. I just now have had time to look into it and it appears that nothing that I have in my /etc/crontab is executing. Code:
# ps aux|grep cron root 1575 0.0 0.1 4720 1380 ?? Is 9:23AM 0:00.07 /usr/sbin/cron -s root 10357 0.0 0.0 452 364 p0 R+ 2:31PM 0:00.00 grep cron my crontab file has this Code:
# /etc/crontab - root's crontab for FreeBSD # # $FreeBSD: src/etc/crontab,v 1.32 2002/11/22 16:13:39 tom Exp $ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin HOME=/var/log # #minute hour mday month wday who command # */5 * * * * root /usr/libexec/atrun # # Save some entropy so that /dev/random can re-seed on boot. */11 * * * * operator /usr/libexec/save-entropy # # Rotate log files every hour, if necessary. 0 * * * * root newsyslog # # Perform daily/weekly/monthly maintenance. 1 3 * * * root periodic daily 15 4 * * 6 root periodic weekly 30 5 1 * * root periodic monthly # # Adjust the time zone if the CMOS clock keeps local time, as opposed to # UTC time. See adjkerntz(8) for details. 1,31 0-5 * * * root adjkerntz -a */5 * * * * cactiuser /usr/local/bin/php /usr/local/share/cacti/poller.php > /usr/local/share/cacti/log/poller.log 2>&1 02 0 * * * root /usr/local/etc/awstats/cgi-bin/awstats.pl -update -config=my.intranet.com */10 * * * * root /usr/local/bin/php /root/cronzweather /usr/local/www/html/joomla */5 * * * * root /usr/local/libexec/nagios/nagios_stats.pl > /dev/null 2>&1 */45 * * * * root /usr/local/bin/php -f /usr/local/www/html/joomla/components/com_gallery2/cron/g2CronJob.php Last edited by beandip; 4th August 2008 at 08:37 PM. |
|
|||
Code:
# crontab -l crontab: no crontab for root according to the tail command it looks like it is executing. Code:
# tail /var/log/cron Aug 4 15:05:00 team /usr/sbin/cron[16731]: (cactiuser) CMD ( /usr/local/bin/php /usr/local/share/cacti/poller.php > /usr/local/share/cacti/log/poller.log 2>&1) Aug 4 15:05:00 team /usr/sbin/cron[16732]: (root) CMD (/usr/libexec/atrun) Aug 4 15:10:00 team /usr/sbin/cron[16863]: (root) CMD (/usr/local/libexec/nagios/nagios_stats.pl > /dev/null 2>&1) Aug 4 15:10:00 team /usr/sbin/cron[16864]: (root) CMD (/usr/local/bin/php /root/cronzweather /usr/local/www/html/joomla) Aug 4 15:10:00 team /usr/sbin/cron[16865]: (cactiuser) CMD ( /usr/local/bin/php /usr/local/share/cacti/poller.php > /usr/local/share/cacti/log/poller.log 2>&1) Aug 4 15:10:00 team /usr/sbin/cron[16866]: (root) CMD (/usr/libexec/atrun) Aug 4 15:11:00 team /usr/sbin/cron[16996]: (operator) CMD (/usr/libexec/save-entropy) Aug 4 15:15:00 team /usr/sbin/cron[17011]: (root) CMD (/usr/local/libexec/nagios/nagios_stats.pl > /dev/null 2>&1) Aug 4 15:15:00 team /usr/sbin/cron[17012]: (cactiuser) CMD ( /usr/local/bin/php /usr/local/share/cacti/poller.php > /usr/local/share/cacti/log/poller.log 2>&1) Aug 4 15:15:00 team /usr/sbin/cron[17013]: (root) CMD (/usr/libexec/atrun) |
|
||||
yeah, cron is just getting everything from /etc/crontab. that's a normal place for system jobs on systems that use /etc/crontab, so don't sweat it. your crontab file is in the right format.
Quote:
|
|
|||
Crontab is working. I had multiple problems that are tied to it that made it look like it was not working.
While troubleshooting I discovered a problem with one of Cacti's MySQL tables. I had to execute a truncate command to fix it and now cacti is working properly again. Thanks for your help. I did not know about the tail command but I see how it can be useful in the future. |
|
||||
Quote:
crontab -l checks the user crontab, which doesn't need the user column. /etc/crontab is the system crontab, and needs to know which user to run each command as. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Working with CVS? | Zmyrgel | OpenBSD General | 15 | 6th October 2009 01:32 PM |
[ OpenBSD 4.5 ] apm -C not working | wraith0x2b | OpenBSD Installation and Upgrading | 17 | 6th May 2009 09:03 AM |
Crontab won't run script | Petrocelli08 | FreeBSD General | 4 | 7th March 2009 04:19 AM |
x11 forwarding over ssh not working | kasse | OpenBSD General | 14 | 23rd December 2008 02:21 PM |
pf: why is that rule not working? | ivanatora | FreeBSD General | 14 | 11th December 2008 09:32 AM |