Cron Weirdness 2

Started by lewoke, June 27, 2020, 06:44:40 AM

Previous topic - Next topic
June 27, 2020, 06:44:40 AM Last Edit: June 27, 2020, 06:48:01 AM by lewoke
OPNsense 20.1.7-amd64
FreeBSD 11.2-RELEASE-p20-HBSD
OpenSSL 1.1.1g 21 Apr 2020


I was wondering why an old cronjob was still executed at 6am according to the log files

2020-06-27T06:00:00 configd.py: Waking Thinkserver

when the current config (GUI) was as follows

1 0 1 * * /usr/local/sbin/configctl wake wake
1 0 15 * * /usr/local/sbin/configctl wake wake


A similar issue was reported here: https://forum.opnsense.org/index.php?topic=15420.0

So I checked

oot@OPNsense:~ # cat /var/cron/tabs/nobody

And yes it appeared that my old config was still being used

# DO NOT EDIT THIS FILE -- OPNsense auto-generated file
#
# User-defined crontab files can be loaded via /etc/cron.d
# or /usr/local/etc/cron.d and follow the same format as
# /etc/crontab, see the crontab(5) manual page.
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#minute hour mday month wday command
0 06 * * * /usr/local/sbin/configctl wake wake


Only after I manually removed the entry in /var/cron/tabs/nobody
and then clicked Apply in the GUI  (without creating/modifing or deleting an entry) the current config was loaded

oot@OPNsense:~ # cat /var/cron/tabs/nobody

# DO NOT EDIT THIS FILE -- OPNsense auto-generated file
#
# User-defined crontab files can be loaded via /etc/cron.d
# or /usr/local/etc/cron.d and follow the same format as
# /etc/crontab, see the crontab(5) manual page.
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
#minute hour mday month wday command
# Origin/Description: cron/1st of Month Wake Thinkserver for ZFS Scrub
1 0 1 * * /usr/local/sbin/configctl wake wake
# Origin/Description: cron/Remote Backup
0 0 1 * * /usr/local/sbin/configctl system remote backup
# Origin/Description: cron/15th of Month Wake Thinkserver for ZFS Scrub
1 0 15 * * /usr/local/sbin/configctl wake wake