How can I sure cron executed properly?

Issues related to applications and software problems and general support
hack3rcon
Posts: 736
Joined: 2014/11/24 11:04:37

How can I sure cron executed properly?

Post by hack3rcon » 2020/12/17 21:41:32

Hello,
I have below cron tasks:

Code: Select all

# crontab -l
00 23 * * 1 /usr/bin/suricata-update
00 23 * * 1 /usr/local/bin/wp core update --path=/var/www/wordpress/ && /usr/local/bin/wp plugin update --all --path=/var/www/wordpress
And log file tell me:

Code: Select all

# cat /var/log/cron
Dec 13 04:01:01 Server CROND[720515]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 04:01:01 Server run-parts[720515]: (/etc/cron.hourly) starting 0anacron
Dec 13 04:01:01 Server run-parts[720515]: (/etc/cron.hourly) finished 0anacron
Dec 13 05:01:01 Server CROND[721706]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 05:01:01 Server run-parts[721706]: (/etc/cron.hourly) starting 0anacron
Dec 13 05:01:01 Server run-parts[721706]: (/etc/cron.hourly) finished 0anacron
Dec 13 06:01:01 Server CROND[722918]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 06:01:01 Server run-parts[722918]: (/etc/cron.hourly) starting 0anacron
Dec 13 06:01:01 Server run-parts[722918]: (/etc/cron.hourly) finished 0anacron
Dec 13 07:01:01 Server CROND[724128]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 07:01:01 Server run-parts[724128]: (/etc/cron.hourly) starting 0anacron
Dec 13 07:01:01 Server run-parts[724128]: (/etc/cron.hourly) finished 0anacron
Dec 13 08:01:01 Server CROND[725336]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 08:01:01 Server run-parts[725336]: (/etc/cron.hourly) starting 0anacron
Dec 13 08:01:01 Server run-parts[725336]: (/etc/cron.hourly) finished 0anacron
Dec 13 09:01:01 Server CROND[726538]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 09:01:02 Server run-parts[726538]: (/etc/cron.hourly) starting 0anacron
Dec 13 09:01:02 Server run-parts[726538]: (/etc/cron.hourly) finished 0anacron
Dec 13 10:01:01 Server CROND[727762]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 10:01:01 Server run-parts[727762]: (/etc/cron.hourly) starting 0anacron
Dec 13 10:01:01 Server run-parts[727762]: (/etc/cron.hourly) finished 0anacron
Dec 13 11:01:01 Server CROND[728968]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 11:01:01 Server run-parts[728968]: (/etc/cron.hourly) starting 0anacron
Dec 13 11:01:01 Server run-parts[728968]: (/etc/cron.hourly) finished 0anacron
Dec 13 12:00:01 Server CROND[730175]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 13 12:01:01 Server CROND[730180]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 12:01:01 Server run-parts[730180]: (/etc/cron.hourly) starting 0anacron
Dec 13 12:01:01 Server run-parts[730180]: (/etc/cron.hourly) finished 0anacron
Dec 13 13:01:01 Server CROND[731417]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 13:01:01 Server run-parts[731417]: (/etc/cron.hourly) starting 0anacron
Dec 13 13:01:01 Server run-parts[731417]: (/etc/cron.hourly) finished 0anacron
Dec 13 14:01:01 Server CROND[732622]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 14:01:01 Server run-parts[732622]: (/etc/cron.hourly) starting 0anacron
Dec 13 14:01:01 Server run-parts[732622]: (/etc/cron.hourly) finished 0anacron
Dec 13 15:01:01 Server CROND[733819]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 15:01:01 Server run-parts[733819]: (/etc/cron.hourly) starting 0anacron
Dec 13 15:01:01 Server run-parts[733819]: (/etc/cron.hourly) finished 0anacron
Dec 13 16:01:01 Server CROND[735049]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 16:01:01 Server run-parts[735049]: (/etc/cron.hourly) starting 0anacron
Dec 13 16:01:01 Server run-parts[735049]: (/etc/cron.hourly) finished 0anacron
Dec 13 17:01:02 Server CROND[736255]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 17:01:02 Server run-parts[736255]: (/etc/cron.hourly) starting 0anacron
Dec 13 17:01:02 Server run-parts[736255]: (/etc/cron.hourly) finished 0anacron
Dec 13 18:01:01 Server CROND[737460]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 18:01:01 Server run-parts[737460]: (/etc/cron.hourly) starting 0anacron
Dec 13 18:01:01 Server run-parts[737460]: (/etc/cron.hourly) finished 0anacron
Dec 13 19:01:01 Server CROND[738674]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 19:01:01 Server run-parts[738674]: (/etc/cron.hourly) starting 0anacron
Dec 13 19:01:01 Server run-parts[738674]: (/etc/cron.hourly) finished 0anacron
Dec 13 20:01:01 Server CROND[739897]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 20:01:01 Server run-parts[739897]: (/etc/cron.hourly) starting 0anacron
Dec 13 20:01:01 Server run-parts[739897]: (/etc/cron.hourly) finished 0anacron
Dec 13 21:01:01 Server CROND[741097]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 21:01:01 Server run-parts[741097]: (/etc/cron.hourly) starting 0anacron
Dec 13 21:01:01 Server run-parts[741097]: (/etc/cron.hourly) finished 0anacron
Dec 13 22:01:01 Server CROND[742312]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 22:01:01 Server run-parts[742312]: (/etc/cron.hourly) starting 0anacron
Dec 13 22:01:01 Server run-parts[742312]: (/etc/cron.hourly) finished 0anacron
Dec 13 23:01:01 Server CROND[743603]: (root) CMD (run-parts /etc/cron.hourly)
Dec 13 23:01:01 Server run-parts[743603]: (/etc/cron.hourly) starting 0anacron
Dec 13 23:01:01 Server run-parts[743603]: (/etc/cron.hourly) finished 0anacron
Dec 14 00:00:01 Server CROND[744813]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 14 00:01:01 Server CROND[744817]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 00:01:01 Server run-parts[744817]: (/etc/cron.hourly) starting 0anacron
Dec 14 00:01:01 Server anacron[744826]: Anacron started on 2020-12-14
Dec 14 00:01:01 Server anacron[744826]: Normal exit (0 jobs run)
Dec 14 00:01:01 Server run-parts[744817]: (/etc/cron.hourly) finished 0anacron
Dec 14 01:01:01 Server CROND[746785]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 01:01:01 Server run-parts[746785]: (/etc/cron.hourly) starting 0anacron
Dec 14 01:01:01 Server anacron[746794]: Anacron started on 2020-12-14
Dec 14 01:01:01 Server anacron[746794]: Normal exit (0 jobs run)
Dec 14 01:01:01 Server run-parts[746785]: (/etc/cron.hourly) finished 0anacron
Dec 14 02:01:01 Server CROND[748012]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 02:01:01 Server run-parts[748012]: (/etc/cron.hourly) starting 0anacron
Dec 14 02:01:01 Server anacron[748021]: Anacron started on 2020-12-14
Dec 14 02:01:01 Server anacron[748021]: Normal exit (0 jobs run)
Dec 14 02:01:01 Server run-parts[748012]: (/etc/cron.hourly) finished 0anacron
Dec 14 03:01:01 Server CROND[749259]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 03:01:01 Server run-parts[749259]: (/etc/cron.hourly) starting 0anacron
Dec 14 03:01:01 Server anacron[749268]: Anacron started on 2020-12-14
Dec 14 03:01:01 Server anacron[749268]: Will run job `cron.daily' in 18 min.
Dec 14 03:01:01 Server anacron[749268]: Jobs will be executed sequentially
Dec 14 03:01:01 Server run-parts[749259]: (/etc/cron.hourly) finished 0anacron
Dec 14 03:19:01 Server anacron[749268]: Job `cron.daily' started
Dec 14 03:19:01 Server run-parts[749300]: (/etc/cron.daily) starting logrotate
Dec 14 03:19:01 Server run-parts[749300]: (/etc/cron.daily) finished logrotate
Dec 14 03:19:01 Server anacron[749268]: Job `cron.daily' terminated
Dec 14 03:19:01 Server anacron[749268]: Normal exit (1 job run)
Dec 14 04:01:01 Server CROND[750520]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 04:01:01 Server run-parts[750520]: (/etc/cron.hourly) starting 0anacron
Dec 14 04:01:01 Server run-parts[750520]: (/etc/cron.hourly) finished 0anacron
Dec 14 05:01:01 Server CROND[751722]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 05:01:01 Server run-parts[751722]: (/etc/cron.hourly) starting 0anacron
Dec 14 05:01:01 Server run-parts[751722]: (/etc/cron.hourly) finished 0anacron
Dec 14 06:01:01 Server CROND[752923]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 06:01:01 Server run-parts[752923]: (/etc/cron.hourly) starting 0anacron
Dec 14 06:01:01 Server run-parts[752923]: (/etc/cron.hourly) finished 0anacron
Dec 14 07:01:01 Server CROND[754166]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 07:01:01 Server run-parts[754166]: (/etc/cron.hourly) starting 0anacron
Dec 14 07:01:01 Server run-parts[754166]: (/etc/cron.hourly) finished 0anacron
Dec 14 08:01:01 Server CROND[755377]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 08:01:01 Server run-parts[755377]: (/etc/cron.hourly) starting 0anacron
Dec 14 08:01:01 Server run-parts[755377]: (/etc/cron.hourly) finished 0anacron
Dec 14 09:01:01 Server CROND[756580]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 09:01:02 Server run-parts[756580]: (/etc/cron.hourly) starting 0anacron
Dec 14 09:01:02 Server run-parts[756580]: (/etc/cron.hourly) finished 0anacron
Dec 14 10:01:01 Server CROND[757821]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 10:01:01 Server run-parts[757821]: (/etc/cron.hourly) starting 0anacron
Dec 14 10:01:01 Server run-parts[757821]: (/etc/cron.hourly) finished 0anacron
Dec 14 11:01:01 Server CROND[759026]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 11:01:01 Server run-parts[759026]: (/etc/cron.hourly) starting 0anacron
Dec 14 11:01:01 Server run-parts[759026]: (/etc/cron.hourly) finished 0anacron
Dec 14 12:00:01 Server CROND[760227]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 14 12:01:01 Server CROND[760233]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 12:01:01 Server run-parts[760233]: (/etc/cron.hourly) starting 0anacron
Dec 14 12:01:01 Server run-parts[760233]: (/etc/cron.hourly) finished 0anacron
Dec 14 13:01:01 Server CROND[761463]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 13:01:01 Server run-parts[761463]: (/etc/cron.hourly) starting 0anacron
Dec 14 13:01:01 Server run-parts[761463]: (/etc/cron.hourly) finished 0anacron
Dec 14 14:01:01 Server CROND[762678]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 14:01:01 Server run-parts[762678]: (/etc/cron.hourly) starting 0anacron
Dec 14 14:01:01 Server run-parts[762678]: (/etc/cron.hourly) finished 0anacron
Dec 14 15:01:01 Server CROND[763884]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 15:01:01 Server run-parts[763884]: (/etc/cron.hourly) starting 0anacron
Dec 14 15:01:01 Server run-parts[763884]: (/etc/cron.hourly) finished 0anacron
Dec 14 16:01:01 Server CROND[765099]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 16:01:01 Server run-parts[765099]: (/etc/cron.hourly) starting 0anacron
Dec 14 16:01:01 Server run-parts[765099]: (/etc/cron.hourly) finished 0anacron
Dec 14 17:01:01 Server CROND[766302]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 17:01:01 Server run-parts[766302]: (/etc/cron.hourly) starting 0anacron
Dec 14 17:01:01 Server run-parts[766302]: (/etc/cron.hourly) finished 0anacron
Dec 14 18:01:01 Server CROND[767504]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 18:01:01 Server run-parts[767504]: (/etc/cron.hourly) starting 0anacron
Dec 14 18:01:01 Server run-parts[767504]: (/etc/cron.hourly) finished 0anacron
Dec 14 19:01:01 Server CROND[768723]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 19:01:01 Server run-parts[768723]: (/etc/cron.hourly) starting 0anacron
Dec 14 19:01:01 Server run-parts[768723]: (/etc/cron.hourly) finished 0anacron
Dec 14 20:01:01 Server CROND[769928]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 20:01:01 Server run-parts[769928]: (/etc/cron.hourly) starting 0anacron
Dec 14 20:01:01 Server run-parts[769928]: (/etc/cron.hourly) finished 0anacron
Dec 14 21:01:01 Server CROND[771129]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 21:01:01 Server run-parts[771129]: (/etc/cron.hourly) starting 0anacron
Dec 14 21:01:01 Server run-parts[771129]: (/etc/cron.hourly) finished 0anacron
Dec 14 22:01:01 Server CROND[772362]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 22:01:01 Server run-parts[772362]: (/etc/cron.hourly) starting 0anacron
Dec 14 22:01:01 Server run-parts[772362]: (/etc/cron.hourly) finished 0anacron
Dec 14 23:00:01 Server CROND[773666]: (root) CMD (/usr/bin/suricata-update)
Dec 14 23:01:01 Server CROND[773671]: (root) CMD (run-parts /etc/cron.hourly)
Dec 14 23:01:01 Server run-parts[773671]: (/etc/cron.hourly) starting 0anacron
Dec 14 23:01:01 Server run-parts[773671]: (/etc/cron.hourly) finished 0anacron
Dec 15 00:00:01 Server CROND[774899]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 15 00:01:01 Server CROND[774913]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 00:01:01 Server run-parts[774913]: (/etc/cron.hourly) starting 0anacron
Dec 15 00:01:01 Server anacron[774922]: Anacron started on 2020-12-15
Dec 15 00:01:01 Server anacron[774922]: Normal exit (0 jobs run)
Dec 15 00:01:01 Server run-parts[774913]: (/etc/cron.hourly) finished 0anacron
Dec 15 01:01:01 Server CROND[776877]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 01:01:01 Server run-parts[776877]: (/etc/cron.hourly) starting 0anacron
Dec 15 01:01:01 Server anacron[776886]: Anacron started on 2020-12-15
Dec 15 01:01:01 Server anacron[776886]: Normal exit (0 jobs run)
Dec 15 01:01:01 Server run-parts[776877]: (/etc/cron.hourly) finished 0anacron
Dec 15 02:01:01 Server CROND[778087]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 02:01:01 Server run-parts[778087]: (/etc/cron.hourly) starting 0anacron
Dec 15 02:01:01 Server anacron[778096]: Anacron started on 2020-12-15
Dec 15 02:01:01 Server anacron[778096]: Normal exit (0 jobs run)
Dec 15 02:01:01 Server run-parts[778087]: (/etc/cron.hourly) finished 0anacron
Dec 15 03:01:01 Server CROND[779289]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 03:01:01 Server run-parts[779289]: (/etc/cron.hourly) starting 0anacron
Dec 15 03:01:01 Server anacron[779298]: Anacron started on 2020-12-15
Dec 15 03:01:01 Server anacron[779298]: Will run job `cron.daily' in 45 min.
Dec 15 03:01:01 Server anacron[779298]: Jobs will be executed sequentially
Dec 15 03:01:01 Server run-parts[779289]: (/etc/cron.hourly) finished 0anacron
Dec 15 03:46:01 Server anacron[779298]: Job `cron.daily' started
Dec 15 03:46:01 Server run-parts[779930]: (/etc/cron.daily) starting logrotate
Dec 15 03:46:01 Server run-parts[779930]: (/etc/cron.daily) finished logrotate
Dec 15 03:46:01 Server anacron[779298]: Job `cron.daily' terminated
Dec 15 03:46:01 Server anacron[779298]: Normal exit (1 job run)
Dec 15 04:01:01 Server CROND[780510]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 04:01:01 Server run-parts[780510]: (/etc/cron.hourly) starting 0anacron
Dec 15 04:01:01 Server run-parts[780510]: (/etc/cron.hourly) finished 0anacron
Dec 15 05:01:01 Server CROND[781707]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 05:01:01 Server run-parts[781707]: (/etc/cron.hourly) starting 0anacron
Dec 15 05:01:01 Server run-parts[781707]: (/etc/cron.hourly) finished 0anacron
Dec 15 06:01:01 Server CROND[782911]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 06:01:01 Server run-parts[782911]: (/etc/cron.hourly) starting 0anacron
Dec 15 06:01:01 Server run-parts[782911]: (/etc/cron.hourly) finished 0anacron
Dec 15 07:01:01 Server CROND[784134]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 07:01:01 Server run-parts[784134]: (/etc/cron.hourly) starting 0anacron
Dec 15 07:01:01 Server run-parts[784134]: (/etc/cron.hourly) finished 0anacron
Dec 15 08:01:01 Server CROND[785333]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 08:01:01 Server run-parts[785333]: (/etc/cron.hourly) starting 0anacron
Dec 15 08:01:01 Server run-parts[785333]: (/etc/cron.hourly) finished 0anacron
Dec 15 09:01:01 Server CROND[786525]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 09:01:01 Server run-parts[786525]: (/etc/cron.hourly) starting 0anacron
Dec 15 09:01:01 Server run-parts[786525]: (/etc/cron.hourly) finished 0anacron
Dec 15 10:01:01 Server CROND[787744]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 10:01:01 Server run-parts[787744]: (/etc/cron.hourly) starting 0anacron
Dec 15 10:01:01 Server run-parts[787744]: (/etc/cron.hourly) finished 0anacron
Dec 15 11:01:01 Server CROND[788940]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 11:01:01 Server run-parts[788940]: (/etc/cron.hourly) starting 0anacron
Dec 15 11:01:02 Server run-parts[788940]: (/etc/cron.hourly) finished 0anacron
Dec 15 12:00:01 Server CROND[790138]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 15 12:01:01 Server CROND[790146]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 12:01:01 Server run-parts[790146]: (/etc/cron.hourly) starting 0anacron
Dec 15 12:01:01 Server run-parts[790146]: (/etc/cron.hourly) finished 0anacron
Dec 15 13:01:01 Server CROND[791377]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 13:01:01 Server run-parts[791377]: (/etc/cron.hourly) starting 0anacron
Dec 15 13:01:01 Server run-parts[791377]: (/etc/cron.hourly) finished 0anacron
Dec 15 14:01:01 Server CROND[792587]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 14:01:01 Server run-parts[792587]: (/etc/cron.hourly) starting 0anacron
Dec 15 14:01:01 Server run-parts[792587]: (/etc/cron.hourly) finished 0anacron
Dec 15 15:01:01 Server CROND[793786]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 15:01:01 Server run-parts[793786]: (/etc/cron.hourly) starting 0anacron
Dec 15 15:01:01 Server run-parts[793786]: (/etc/cron.hourly) finished 0anacron
Dec 15 16:01:01 Server CROND[795009]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 16:01:02 Server run-parts[795009]: (/etc/cron.hourly) starting 0anacron
Dec 15 16:01:02 Server run-parts[795009]: (/etc/cron.hourly) finished 0anacron
Dec 15 17:01:01 Server CROND[796210]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 17:01:01 Server run-parts[796210]: (/etc/cron.hourly) starting 0anacron
Dec 15 17:01:01 Server run-parts[796210]: (/etc/cron.hourly) finished 0anacron
Dec 15 18:01:01 Server CROND[797412]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 18:01:01 Server run-parts[797412]: (/etc/cron.hourly) starting 0anacron
Dec 15 18:01:01 Server run-parts[797412]: (/etc/cron.hourly) finished 0anacron
Dec 15 19:01:01 Server CROND[798630]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 19:01:01 Server run-parts[798630]: (/etc/cron.hourly) starting 0anacron
Dec 15 19:01:01 Server run-parts[798630]: (/etc/cron.hourly) finished 0anacron
Dec 15 20:01:01 Server CROND[799829]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 20:01:01 Server run-parts[799829]: (/etc/cron.hourly) starting 0anacron
Dec 15 20:01:01 Server run-parts[799829]: (/etc/cron.hourly) finished 0anacron
Dec 15 21:01:01 Server CROND[801030]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 21:01:01 Server run-parts[801030]: (/etc/cron.hourly) starting 0anacron
Dec 15 21:01:01 Server run-parts[801030]: (/etc/cron.hourly) finished 0anacron
Dec 15 22:01:01 Server CROND[802271]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 22:01:01 Server run-parts[802271]: (/etc/cron.hourly) starting 0anacron
Dec 15 22:01:01 Server run-parts[802271]: (/etc/cron.hourly) finished 0anacron
Dec 15 23:01:01 Server CROND[803584]: (root) CMD (run-parts /etc/cron.hourly)
Dec 15 23:01:01 Server run-parts[803584]: (/etc/cron.hourly) starting 0anacron
Dec 15 23:01:01 Server run-parts[803584]: (/etc/cron.hourly) finished 0anacron
Dec 16 00:00:01 Server CROND[804804]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 16 00:01:01 Server CROND[804807]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 00:01:01 Server run-parts[804807]: (/etc/cron.hourly) starting 0anacron
Dec 16 00:01:01 Server anacron[804816]: Anacron started on 2020-12-16
Dec 16 00:01:01 Server anacron[804816]: Normal exit (0 jobs run)
Dec 16 00:01:01 Server run-parts[804807]: (/etc/cron.hourly) finished 0anacron
Dec 16 01:01:01 Server CROND[806786]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 01:01:01 Server run-parts[806786]: (/etc/cron.hourly) starting 0anacron
Dec 16 01:01:01 Server anacron[806795]: Anacron started on 2020-12-16
Dec 16 01:01:01 Server anacron[806795]: Normal exit (0 jobs run)
Dec 16 01:01:01 Server run-parts[806786]: (/etc/cron.hourly) finished 0anacron
Dec 16 02:01:01 Server CROND[807989]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 02:01:01 Server run-parts[807989]: (/etc/cron.hourly) starting 0anacron
Dec 16 02:01:01 Server anacron[807998]: Anacron started on 2020-12-16
Dec 16 02:01:01 Server anacron[807998]: Normal exit (0 jobs run)
Dec 16 02:01:01 Server run-parts[807989]: (/etc/cron.hourly) finished 0anacron
Dec 16 03:01:01 Server CROND[809189]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 03:01:01 Server run-parts[809189]: (/etc/cron.hourly) starting 0anacron
Dec 16 03:01:01 Server anacron[809198]: Anacron started on 2020-12-16
Dec 16 03:01:01 Server anacron[809198]: Will run job `cron.daily' in 20 min.
Dec 16 03:01:01 Server anacron[809198]: Jobs will be executed sequentially
Dec 16 03:01:01 Server run-parts[809189]: (/etc/cron.hourly) finished 0anacron
Dec 16 03:21:01 Server anacron[809198]: Job `cron.daily' started
Dec 16 03:21:01 Server run-parts[809216]: (/etc/cron.daily) starting logrotate
Dec 16 03:21:01 Server run-parts[809216]: (/etc/cron.daily) finished logrotate
Dec 16 03:21:01 Server anacron[809198]: Job `cron.daily' terminated
Dec 16 03:21:01 Server anacron[809198]: Normal exit (1 job run)
Dec 16 04:01:01 Server CROND[810415]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 04:01:01 Server run-parts[810415]: (/etc/cron.hourly) starting 0anacron
Dec 16 04:01:01 Server run-parts[810415]: (/etc/cron.hourly) finished 0anacron
Dec 16 05:01:01 Server CROND[811616]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 05:01:01 Server run-parts[811616]: (/etc/cron.hourly) starting 0anacron
Dec 16 05:01:01 Server run-parts[811616]: (/etc/cron.hourly) finished 0anacron
Dec 16 06:01:01 Server CROND[812810]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 06:01:01 Server run-parts[812810]: (/etc/cron.hourly) starting 0anacron
Dec 16 06:01:01 Server run-parts[812810]: (/etc/cron.hourly) finished 0anacron
Dec 16 07:01:01 Server CROND[845884]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 07:01:01 Server run-parts[845884]: (/etc/cron.hourly) starting 0anacron
Dec 16 07:01:01 Server run-parts[845884]: (/etc/cron.hourly) finished 0anacron
Dec 16 08:01:01 Server CROND[847080]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 08:01:01 Server run-parts[847080]: (/etc/cron.hourly) starting 0anacron
Dec 16 08:01:01 Server run-parts[847080]: (/etc/cron.hourly) finished 0anacron
Dec 16 09:01:01 Server CROND[848284]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 09:01:02 Server run-parts[848284]: (/etc/cron.hourly) starting 0anacron
Dec 16 09:01:02 Server run-parts[848284]: (/etc/cron.hourly) finished 0anacron
Dec 16 10:01:01 Server CROND[849495]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 10:01:01 Server run-parts[849495]: (/etc/cron.hourly) starting 0anacron
Dec 16 10:01:01 Server run-parts[849495]: (/etc/cron.hourly) finished 0anacron
Dec 16 11:01:01 Server CROND[850701]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 11:01:01 Server run-parts[850701]: (/etc/cron.hourly) starting 0anacron
Dec 16 11:01:01 Server run-parts[850701]: (/etc/cron.hourly) finished 0anacron
Dec 16 12:00:01 Server CROND[851901]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 16 12:01:01 Server CROND[851907]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 12:01:01 Server run-parts[851907]: (/etc/cron.hourly) starting 0anacron
Dec 16 12:01:01 Server run-parts[851907]: (/etc/cron.hourly) finished 0anacron
Dec 16 13:01:01 Server CROND[853127]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 13:01:01 Server run-parts[853127]: (/etc/cron.hourly) starting 0anacron
Dec 16 13:01:01 Server run-parts[853127]: (/etc/cron.hourly) finished 0anacron
Dec 16 14:01:01 Server CROND[854322]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 14:01:01 Server run-parts[854322]: (/etc/cron.hourly) starting 0anacron
Dec 16 14:01:01 Server run-parts[854322]: (/etc/cron.hourly) finished 0anacron
Dec 16 15:01:01 Server CROND[855515]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 15:01:01 Server run-parts[855515]: (/etc/cron.hourly) starting 0anacron
Dec 16 15:01:02 Server run-parts[855515]: (/etc/cron.hourly) finished 0anacron
Dec 16 16:01:01 Server CROND[856736]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 16:01:01 Server run-parts[856736]: (/etc/cron.hourly) starting 0anacron
Dec 16 16:01:01 Server run-parts[856736]: (/etc/cron.hourly) finished 0anacron
Dec 16 17:01:01 Server CROND[858011]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 17:01:01 Server run-parts[858011]: (/etc/cron.hourly) starting 0anacron
Dec 16 17:01:01 Server run-parts[858011]: (/etc/cron.hourly) finished 0anacron
Dec 16 18:01:01 Server CROND[859218]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 18:01:01 Server run-parts[859218]: (/etc/cron.hourly) starting 0anacron
Dec 16 18:01:01 Server run-parts[859218]: (/etc/cron.hourly) finished 0anacron
Dec 16 19:01:01 Server CROND[860429]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 19:01:01 Server run-parts[860429]: (/etc/cron.hourly) starting 0anacron
Dec 16 19:01:01 Server run-parts[860429]: (/etc/cron.hourly) finished 0anacron
Dec 16 20:01:01 Server CROND[861633]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 20:01:01 Server run-parts[861633]: (/etc/cron.hourly) starting 0anacron
Dec 16 20:01:01 Server run-parts[861633]: (/etc/cron.hourly) finished 0anacron
Dec 16 21:01:01 Server CROND[862838]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 21:01:01 Server run-parts[862838]: (/etc/cron.hourly) starting 0anacron
Dec 16 21:01:01 Server run-parts[862838]: (/etc/cron.hourly) finished 0anacron
Dec 16 22:01:01 Server CROND[864045]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 22:01:01 Server run-parts[864045]: (/etc/cron.hourly) starting 0anacron
Dec 16 22:01:01 Server run-parts[864045]: (/etc/cron.hourly) finished 0anacron
Dec 16 23:01:01 Server CROND[865235]: (root) CMD (run-parts /etc/cron.hourly)
Dec 16 23:01:01 Server run-parts[865235]: (/etc/cron.hourly) starting 0anacron
Dec 16 23:01:01 Server run-parts[865235]: (/etc/cron.hourly) finished 0anacron
Dec 17 00:00:01 Server CROND[866420]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 17 00:01:01 Server CROND[866429]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 00:01:01 Server run-parts[866429]: (/etc/cron.hourly) starting 0anacron
Dec 17 00:01:01 Server anacron[866438]: Anacron started on 2020-12-17
Dec 17 00:01:01 Server anacron[866438]: Normal exit (0 jobs run)
Dec 17 00:01:01 Server run-parts[866429]: (/etc/cron.hourly) finished 0anacron
Dec 17 01:01:01 Server CROND[868386]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 01:01:01 Server run-parts[868386]: (/etc/cron.hourly) starting 0anacron
Dec 17 01:01:01 Server anacron[868395]: Anacron started on 2020-12-17
Dec 17 01:01:01 Server anacron[868395]: Normal exit (0 jobs run)
Dec 17 01:01:01 Server run-parts[868386]: (/etc/cron.hourly) finished 0anacron
Dec 17 02:01:01 Server CROND[869601]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 02:01:01 Server run-parts[869601]: (/etc/cron.hourly) starting 0anacron
Dec 17 02:01:01 Server anacron[869610]: Anacron started on 2020-12-17
Dec 17 02:01:01 Server run-parts[869601]: (/etc/cron.hourly) finished 0anacron
Dec 17 02:01:01 Server anacron[869610]: Normal exit (0 jobs run)
Dec 17 03:01:01 Server CROND[870799]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 03:01:01 Server run-parts[870799]: (/etc/cron.hourly) starting 0anacron
Dec 17 03:01:01 Server anacron[870808]: Anacron started on 2020-12-17
Dec 17 03:01:01 Server anacron[870808]: Will run job `cron.daily' in 28 min.
Dec 17 03:01:01 Server anacron[870808]: Jobs will be executed sequentially
Dec 17 03:01:01 Server run-parts[870799]: (/etc/cron.hourly) finished 0anacron
Dec 17 03:29:01 Server anacron[870808]: Job `cron.daily' started
Dec 17 03:29:01 Server run-parts[871387]: (/etc/cron.daily) starting logrotate
Dec 17 03:29:01 Server run-parts[871387]: (/etc/cron.daily) finished logrotate
Dec 17 03:29:01 Server anacron[870808]: Job `cron.daily' terminated
Dec 17 03:29:01 Server anacron[870808]: Normal exit (1 job run)
Dec 17 04:01:01 Server CROND[872035]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 04:01:01 Server run-parts[872035]: (/etc/cron.hourly) starting 0anacron
Dec 17 04:01:01 Server run-parts[872035]: (/etc/cron.hourly) finished 0anacron
Dec 17 05:01:01 Server CROND[873239]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 05:01:01 Server run-parts[873239]: (/etc/cron.hourly) starting 0anacron
Dec 17 05:01:01 Server run-parts[873239]: (/etc/cron.hourly) finished 0anacron
Dec 17 06:01:01 Server CROND[874441]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 06:01:01 Server run-parts[874441]: (/etc/cron.hourly) starting 0anacron
Dec 17 06:01:01 Server run-parts[874441]: (/etc/cron.hourly) finished 0anacron
Dec 17 07:01:01 Server CROND[875679]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 07:01:01 Server run-parts[875679]: (/etc/cron.hourly) starting 0anacron
Dec 17 07:01:01 Server run-parts[875679]: (/etc/cron.hourly) finished 0anacron
Dec 17 08:01:01 Server CROND[876883]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 08:01:01 Server run-parts[876883]: (/etc/cron.hourly) starting 0anacron
Dec 17 08:01:01 Server run-parts[876883]: (/etc/cron.hourly) finished 0anacron
Dec 17 09:01:01 Server CROND[878117]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 09:01:01 Server run-parts[878117]: (/etc/cron.hourly) starting 0anacron
Dec 17 09:01:01 Server run-parts[878117]: (/etc/cron.hourly) finished 0anacron
Dec 17 10:01:01 Server CROND[879326]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 10:01:01 Server run-parts[879326]: (/etc/cron.hourly) starting 0anacron
Dec 17 10:01:01 Server run-parts[879326]: (/etc/cron.hourly) finished 0anacron
Dec 17 11:01:01 Server CROND[880581]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 11:01:01 Server run-parts[880581]: (/etc/cron.hourly) starting 0anacron
Dec 17 11:01:01 Server run-parts[880581]: (/etc/cron.hourly) finished 0anacron
Dec 17 12:00:01 Server CROND[881781]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 17 12:01:01 Server CROND[881786]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 12:01:02 Server run-parts[881786]: (/etc/cron.hourly) starting 0anacron
Dec 17 12:01:02 Server run-parts[881786]: (/etc/cron.hourly) finished 0anacron
Dec 17 13:01:01 Server CROND[882997]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 13:01:01 Server run-parts[882997]: (/etc/cron.hourly) starting 0anacron
Dec 17 13:01:01 Server run-parts[882997]: (/etc/cron.hourly) finished 0anacron
Dec 17 14:01:01 Server CROND[884213]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 14:01:01 Server run-parts[884213]: (/etc/cron.hourly) starting 0anacron
Dec 17 14:01:01 Server run-parts[884213]: (/etc/cron.hourly) finished 0anacron
Dec 17 15:01:01 Server CROND[885418]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 15:01:01 Server run-parts[885418]: (/etc/cron.hourly) starting 0anacron
Dec 17 15:01:01 Server run-parts[885418]: (/etc/cron.hourly) finished 0anacron
Dec 17 16:01:01 Server CROND[886683]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 16:01:01 Server run-parts[886683]: (/etc/cron.hourly) starting 0anacron
Dec 17 16:01:01 Server run-parts[886683]: (/etc/cron.hourly) finished 0anacron
Dec 17 17:01:01 Server CROND[887905]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 17:01:01 Server run-parts[887905]: (/etc/cron.hourly) starting 0anacron
Dec 17 17:01:01 Server run-parts[887905]: (/etc/cron.hourly) finished 0anacron
Dec 17 18:01:01 Server CROND[889104]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 18:01:01 Server run-parts[889104]: (/etc/cron.hourly) starting 0anacron
Dec 17 18:01:01 Server run-parts[889104]: (/etc/cron.hourly) finished 0anacron
Dec 17 19:01:01 Server CROND[890311]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 19:01:01 Server run-parts[890311]: (/etc/cron.hourly) starting 0anacron
Dec 17 19:01:01 Server run-parts[890311]: (/etc/cron.hourly) finished 0anacron
Dec 17 20:01:01 Server CROND[891536]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 20:01:01 Server run-parts[891536]: (/etc/cron.hourly) starting 0anacron
Dec 17 20:01:01 Server run-parts[891536]: (/etc/cron.hourly) finished 0anacron
Dec 17 21:01:01 Server CROND[892735]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 21:01:01 Server run-parts[892735]: (/etc/cron.hourly) starting 0anacron
Dec 17 21:01:01 Server run-parts[892735]: (/etc/cron.hourly) finished 0anacron
Dec 17 22:01:01 Server CROND[893941]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 22:01:01 Server run-parts[893941]: (/etc/cron.hourly) starting 0anacron
Dec 17 22:01:01 Server run-parts[893941]: (/etc/cron.hourly) finished 0anacron
Dec 17 23:01:01 Server CROND[895267]: (root) CMD (run-parts /etc/cron.hourly)
Dec 17 23:01:01 Server run-parts[895267]: (/etc/cron.hourly) starting 0anacron
Dec 17 23:01:01 Server run-parts[895267]: (/etc/cron.hourly) finished 0anacron
Dec 18 00:00:01 Server CROND[896470]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 18 00:01:01 Server CROND[896479]: (root) CMD (run-parts /etc/cron.hourly)
Dec 18 00:01:01 Server run-parts[896479]: (/etc/cron.hourly) starting 0anacron
Dec 18 00:01:01 Server anacron[896488]: Anacron started on 2020-12-18
Dec 18 00:01:01 Server anacron[896488]: Normal exit (0 jobs run)
Dec 18 00:01:02 Server run-parts[896479]: (/etc/cron.hourly) finished 0anacron
Dec 18 01:01:01 Server CROND[898439]: (root) CMD (run-parts /etc/cron.hourly)
Dec 18 01:01:01 Server run-parts[898439]: (/etc/cron.hourly) starting 0anacron
Dec 18 01:01:01 Server anacron[898448]: Anacron started on 2020-12-18
Dec 18 01:01:01 Server anacron[898448]: Normal exit (0 jobs run)
Dec 18 01:01:01 Server run-parts[898439]: (/etc/cron.hourly) finished 0anacron
Dec 18 01:03:39 Server crontab[898511]: (root) LIST (root)
Dec 18 01:03:44 Server crontab[898512]: (root) BEGIN EDIT (root)
Dec 18 01:04:38 Server crontab[898512]: (root) REPLACE (root)
Dec 18 01:04:38 Server crontab[898512]: (root) END EDIT (root)
Dec 18 01:04:40 Server crontab[898518]: (root) LIST (root)
Dec 18 01:05:01 Server crond[468693]: (root) RELOAD (/var/spool/cron/root)
But which of these lines related to which task?

Thank you.

pjsr2
Posts: 554
Joined: 2014/03/27 20:11:07

Re: How can I sure cron executed properly?

Post by pjsr2 » 2020/12/18 08:25:33

Read man crontab

The first five fields mean:
  1. minute 0-59
  2. hour 0-23
  3. day of month 1-31
  4. month 1-12 (or names, see below)
  5. day of week 0-7 (0 or 7 is Sunday, or use names)
So "00 23 * * 1" means your task runs on Mondays at 23:00.
Assuming that the excerpt from your log file is from this year, Monday would be Dec. 12th, which is not shown in the logs.

pjsr2
Posts: 554
Joined: 2014/03/27 20:11:07

Re: How can I sure cron executed properly?

Post by pjsr2 » 2020/12/18 08:33:56

How can I sure cron executed properly?
If a cron task writes output, that output is send as an email message to (by default) root.

So is you want to be sure that a task was executed successfully, you can do something like:

Code: Select all

00 23 * * 1 /usr/bin/suricata-update && /usr/bin/echo "surricata-update done"
Then root will receive an email that ends with the text "surricata-update done" when the task completed.

hack3rcon
Posts: 736
Joined: 2014/11/24 11:04:37

Re: How can I sure cron executed properly?

Post by hack3rcon » 2020/12/19 11:45:03

pjsr2 wrote:
2020/12/18 08:33:56
How can I sure cron executed properly?
If a cron task writes output, that output is send as an email message to (by default) root.

So is you want to be sure that a task was executed successfully, you can do something like:

Code: Select all

00 23 * * 1 /usr/bin/suricata-update && /usr/bin/echo "surricata-update done"
Then root will receive an email that ends with the text "surricata-update done" when the task completed.
Thank you.
Can I store it as a file instead of email?

hack3rcon
Posts: 736
Joined: 2014/11/24 11:04:37

Re: How can I sure cron executed properly?

Post by hack3rcon » 2020/12/19 11:45:29

pjsr2 wrote:
2020/12/18 08:25:33
Read man crontab

The first five fields mean:
  1. minute 0-59
  2. hour 0-23
  3. day of month 1-31
  4. month 1-12 (or names, see below)
  5. day of week 0-7 (0 or 7 is Sunday, or use names)
So "00 23 * * 1" means your task runs on Mondays at 23:00.
Assuming that the excerpt from your log file is from this year, Monday would be Dec. 12th, which is not shown in the logs.
Thus, not executed? Is syntax wrong?

lightman47
Posts: 1250
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: How can I sure cron executed properly?

Post by lightman47 » 2020/12/19 20:35:01

As pjsr2 wrote:
So "00 23 * * 1" means your task runs on Mondays at 23:00.
You can also check your expected results as well as logs (/var/log/messages /var/log/cron).
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

hack3rcon
Posts: 736
Joined: 2014/11/24 11:04:37

Re: How can I sure cron executed properly?

Post by hack3rcon » 2020/12/23 14:00:46

pjsr2 wrote:
2020/12/18 08:33:56
How can I sure cron executed properly?
If a cron task writes output, that output is send as an email message to (by default) root.

So is you want to be sure that a task was executed successfully, you can do something like:

Code: Select all

00 23 * * 1 /usr/bin/suricata-update && /usr/bin/echo "surricata-update done"
Then root will receive an email that ends with the text "surricata-update done" when the task completed.
I edited commands. How can I check email?

pjsr2
Posts: 554
Joined: 2014/03/27 20:11:07

Re: How can I sure cron executed properly?

Post by pjsr2 » 2020/12/29 21:40:09

Log in as root and run command:

Code: Select all

mail
mail is a bit old fashioned text based mail client. See the man pages for how to use it.

hack3rcon
Posts: 736
Joined: 2014/11/24 11:04:37

Re: How can I sure cron executed properly?

Post by hack3rcon » 2020/12/30 11:43:30

Thank you.
I got below error:

Code: Select all

# mail
bash: mail: command not found
And:

Code: Select all

# yum install mail
Last metadata expiration check: 1:22:15 ago on Wed 30 Dec 2020 01:50:23 PM +0330.
No match for argument: mail
Error: Unable to find a match: mail
I checked "cron" log and it tell me:

Code: Select all

# cat /var/log/cron
...
Dec 28 22:01:01 server run-parts[1291099]: (/etc/cron.hourly) starting 0anacron
Dec 28 22:01:01 server run-parts[1291099]: (/etc/cron.hourly) finished 0anacron
Dec 28 23:00:01 server CROND[1292878]: (root) CMD (/usr/local/bin/wp core update --path=/var/www/wp/ && /usr/local/bin/wp plugin update --all --path=/var/www/wp && /usr/bin/echo "WordPress Update done")
Dec 28 23:00:01 server CROND[1292879]: (root) CMD (/usr/bin/suricata-update && /usr/bin/echo "surricata-update done")
Dec 28 23:01:01 server CROND[1292915]: (root) CMD (run-parts /etc/cron.hourly)
Dec 28 23:01:01 server run-parts[1292915]: (/etc/cron.hourly) starting 0anacron
Dec 28 23:01:01 server run-parts[1292915]: (/etc/cron.hourly) finished 0anacron
Dec 29 00:00:01 server CROND[1294677]: (root) CMD (python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q)
Dec 29 00:01:01 server CROND[1294690]: (root) CMD (run-parts /etc/cron.hourly)
Dec 29 00:01:01 server run-parts[1294690]: (/etc/cron.hourly) starting 0anacron
Dec 29 00:01:01 server anacron[1294699]: Anacron started on 2020-12-29
Dec 29 00:01:01 server anacron[1294699]: Normal exit (0 jobs run)
...

MartinR
Posts: 652
Joined: 2015/05/11 07:53:27
Location: UK

Re: How can I sure cron executed properly?

Post by MartinR » 2020/12/30 13:09:49

Under C8 /usr/bin/mail is a link to mailx (and hence also /bin/mail):

Code: Select all

# dnf list mailx
Last metadata expiration check: 1:31:19 ago on Wed 30 Dec 2020 11:35:51 GMT.
Installed Packages
mailx.x86_64                                                          12.5-29.el8                                                           @BaseOS

Post Reply

Return to “CentOS 8 - General Support”