1
20.1 Legacy Series / Cron Weirdness 2
« on: June 27, 2020, 06:44:40 am »Code: [Select]
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
Code: [Select]
2020-06-27T06:00:00 configd.py: Waking Thinkserver
when the current config (GUI) was as follows
Code: [Select]
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
Code: [Select]
oot@OPNsense:~ # cat /var/cron/tabs/nobody
And yes it appeared that my old config was still being used
Code: [Select]
# 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
Code: [Select]
oot@OPNsense:~ # cat /var/cron/tabs/nobody
Code: [Select]
# 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