【cron】沒有依排程執行
檢查服務
# systemctl status crond
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2024-04-22 13:11:51 CST; 7min ago
Main PID: 17677 (crond)
CGroup: /system.slice/crond.service
└─17677 /usr/sbin/crond -n
Apr 22 13:11:51 localhost.localdomain systemd[1]: Started Command Scheduler.
Apr 22 13:11:51 localhost.localdomain crond[17677]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 74% if used.)
Apr 22 13:11:51 localhost.localdomain crond[17677]: (CRON) INFO (running with inotify support)
Apr 22 13:11:51 localhost.localdomain crond[17677]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
# 如果是ubuntu服務是 cron
# 如果沒有起請將服務起來
# systemctl start crond
# 設定開機自動起服務
# systemctl enable crond
檢查log
# 檢查cron log
cat /var/log/cron
# 檢查sys log
grep CRON /var/log/messages