Linux 查看定时器Crontab日志

tail -f /var/log/cron
Apr 17 18:23:01 xyz CROND[5843]: (root) CMDOUT (/bin/sh: line 0: cd: /home/wwwroot/default/jpsx/tortoise/Public: No such file or directory)

通过日志,能够快速定位问题!

查看cron是否开启!

# service crond status
Redirecting to /bin/systemctl status crond.service
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since 五 2020-04-17 18:12:47 CST; 12min ago
 Main PID: 3814 (crond)
   CGroup: /system.slice/crond.service
           └─3814 /usr/sbin/crond -n

重启

# service crond restart
Redirecting to /bin/systemctl restart crond.service
posted @ 2020-04-17 18:27  TBHacker  阅读(2915)  评论(0编辑  收藏  举报