crontab文件位置和日志位置

文件位置

/var/spool/cron/

日志文件位置

/var/log

#ls /var/log/cron*

错误日志

当crond执行任务失败时会给用户发一封邮件

可以将每条crontab中的任务增加自己的日志,便于查找执行失败原因。

eg:6 * * * * /home/stack/test.sh >>/mylog.log 2>&1检查crontab服务状态

服务管理

/etc/init.d/crond status

/etc/init.d/crond restart

/etc/init.d/crond start/stop/restart/reload

crontab定时任务最小执行时间

1分钟

如需要小于1分钟,可通过使用延时来实现每N秒执行或编写shell脚本实现

可参考如下地址:http://blog.csdn.net/fdipzone/article/details/22701113

 

posted @ 2017-02-28 21:20  Jacob_tian  阅读(29580)  评论(0编辑  收藏  举报