cron 记录

文件位置

/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

扫描二维码关注公众号,回复: 4263612 查看本文章

/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

猜你喜欢

转载自blog.csdn.net/kucoll/article/details/82874990
今日推荐