ubuntu 为cacti做一个计划任务 

编译打包和其他
回复
lowkey825826
帖子: 14
注册时间: 2010-12-27 11:04

ubuntu 为cacti做一个计划任务 

#1

帖子 lowkey825826 » 2011-03-09 18:15

发现 var/log/cron 没这个文件 之后网上找了一个方法


修改rsyslog文件,将/etc/rsyslog.d/50-default.conf 文件中的#cron.*前的#删掉;
重启rsyslog服务service rsyslog restart;
重启cron服务service cron restart;
more /var/log/cron.log

查看 日志

代码: 全选

Mar  9 17:35:48 yqmx cron[16861]: (CRON) INFO (pidfile fd = 3)
Mar  9 17:35:48 yqmx cron[16862]: (CRON) STARTUP (fork ok)
Mar  9 17:35:48 yqmx cron[16862]: (*system*) WRONG INODE INFO (/etc/crontab)
Mar  9 17:35:48 yqmx cron[16862]: (CRON) INFO (Skipping @reboot jobs -- not syst
em startup)
Mar  9 17:39:01 yqmx CRON[16876]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ]
 && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/m
axlifetime) -print0 | xargs -n 200 -r -0 rm)
Mar  9 17:39:01 yqmx CRON[16875]: (CRON) info (No MTA installed, discarding outp
ut)
Mar  9 17:41:24 yqmx crontab[16893]: (root) LIST (root)
Mar  9 17:43:30 yqmx cron[16898]: (CRON) INFO (pidfile fd = 3)
Mar  9 17:43:30 yqmx cron[16899]: (CRON) STARTUP (fork ok)
Mar  9 17:43:30 yqmx cron[16899]: (*system*) WRONG INODE INFO (/etc/crontab)
Mar  9 17:43:30 yqmx cron[16899]: (CRON) INFO (Skipping @reboot jobs -- not syst
em startup)
Mar  9 17:45:01 yqmx CRON[16902]: (root) CMD (command -v debian-sa1 > /dev/null
&& debian-sa1 1 1)
Mar  9 17:55:01 yqmx CRON[16942]: (root) CMD (command -v debian-sa1 > /dev/null
&& debian-sa1 1 1)
Mar  9 17:58:02 yqmx crontab[16955]: (root) BEGIN EDIT (root)
Mar  9 18:02:01 yqmx cron[16899]: (*system*) WRONG INODE INFO (/etc/crontab)
Mar  9 18:02:12 yqmx cron[16979]: (CRON) INFO (pidfile fd = 3)
Mar  9 18:02:12 yqmx cron[16980]: (CRON) STARTUP (fork ok)
Mar  9 18:02:12 yqmx cron[16980]: (*system*) WRONG INODE INFO (/etc/crontab)
Mar  9 18:02:12 yqmx cron[16980]: (CRON) INFO (Skipping @reboot jobs -- not syst
root@yqmx:~#
root@yqmx:~# php /var/www/cacti/poller.php
03/09/2011 06:08:19 PM - POLLER: Poller[0] WARNING: Cron is out of sync with the                                              Poller Interval!  The Poller Interval is '60' seconds, with a maximum of a '300                                             ' second Cron, but 373 seconds have passed since the last poll!
03/09/2011 06:08:19 PM - SYSTEM STATS: Time:0.1049 Method:spine Processes:1 Thre                                             ads:1 Hosts:3 HostsPerProcess:3 DataSources:0 RRDsProcessed:0
root@yqmx:~# php /var/www/cacti/poller.php
求解 为啥 cacti 哪里的log 不显示 已经执行,但页面还是自动刷新了。
任务是 
crontag * * * * * php /var/www/cacti/poller.php 2&>1 /dev/null  

急等。
头像
be00
帖子: 805
注册时间: 2008-07-28 19:51
来自: 长沙
联系:

Re: ubuntu 为cacti做一个计划任务 

#2

帖子 be00 » 2011-03-10 11:31

你的crontab怎么写的,没看明白,麻烦把 crontab -l 贴出来看看
我的乌斑兔儿:http://zhanggang.net/m/b/b1/ubuntu右键选择在新的窗体打开
右边有一只黄手 ----> 或者注册Dropbox中文版感谢我
回复