O
O
omgwhoit2020-11-19 01:46:53
Task Schedulers
omgwhoit, 2020-11-19 01:46:53

Why is Crontab skipping a task?

In crontab -e

*/5 * * * * /usr/local/bin/pm2 restart all


In /etc/crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin


Crontab can randomly execute a task at:
22:45
22:50
23:35

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2020-11-19
@omgwhoit

Most likely, cron doesn't skip it, but for some reason the task is not executed.
Place the task in a script, and already write this script in crontab. Now you can add something like

date >> my_log.txt
echo ура! скрипт запустился! >> my_log.txt
...and look in the log to see if there really were gaps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question