Home | Mirror | Search

6. Crontab

crontab 中输出信息很保存到 /var/spool/clientmqueue 需要定时清除

# du -sh /var/* | sort -rn|head -n 10
# cd /var/spool/clientmqueue
# ls | xargs rm -f
		

避免上述情况可以在crontab 中加入 >/dev/null 2>&1

		
# crontab -l
* */2 * * * /usr/local/apache/bin/apachectl restart >/dev/null 2>&1
		
		

crontab 日志

		
$ crontab -l
# m h  dom mon dow   command
0 1 * * * /home/mgmt/backup && echo `date` >> /home/mgmt/backup.log
		
		
comments powered by Disqus