脚本上次运行是在 13 小时前,尽管没有错误。我怎么知道是什么原因造成的? systemd 不间断地工作了大约 2 个月
root@instance:~# systemctl status croncam.service
● croncam.service - Cam online
Loaded: loaded (/etc/systemd/system/croncam.service; static; vendor preset: enabled)
Active: active (running) since Fri 2022-07-15 02:25:12 MSK; 13h ago
TriggeredBy: ● croncam.timer
Main PID: 107552 (bashtophp.sh)
Tasks: 2 (limit: 28554)
Memory: 9.3M
CGroup: /system.slice/croncam.service
├─107552 /bin/bash /root/bashtophp.sh
└─107553 php-cgi -f /var/www/website/public/cam2/camengine.php cron=true
Jul 15 02:25:12 instance systemd[1]: Started Cam online.
Jul 15 02:25:13 instance bashtophp.sh[107553]: <br>здратути<br><pre>Array
Jul 15 02:25:13 instance bashtophp.sh[107553]: (
Jul 15 02:25:13 instance bashtophp.sh[107553]: [time] => 2022-07-15%2002:15:12
Jul 15 02:25:13 instance bashtophp.sh[107553]: [status] => 0
Jul 15 02:25:13 instance bashtophp.sh[107553]: )
root@instance:~# systemctl status croncam.timer
● croncam.timer - Run every 10 minutes
Loaded: loaded (/etc/systemd/system/croncam.timer; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-07-03 13:56:01 MSK; 1 weeks 5 days ago
Trigger: n/a
Triggers: ● croncam.service
Jul 03 13:56:01 instance systemd[1]: Started Run every 10 minutes.
我认为如果我重新启动它,它会像以前一样工作,但我想知道这次停止的原因。
服务
[Unit]
Description=Cam online
[Service]
Type=simple
ExecStart=/root/bashtophp.sh
计时器
[Unit]
Description=Run every 10 minutes
[Timer]
OnBootSec=1min
OnUnitActiveSec=10min
Unit=croncam.service
[Install]
WantedBy=multi-user.target
bashtophp.sh
php-cgi -f /var/www/website/public/cam2/camengine.php cron=true
apache2 日志中没有错误...我还能在哪里查看可能导致此停止的原因?