OPNsense Forum

English Forums => 24.7, 24.10 Legacy Series => Topic started by: zemanek on April 16, 2025, 08:20:50 AM

Title: CRON jobs in /usr/local/etc/cron.d are not run
Post by: zemanek on April 16, 2025, 08:20:50 AM
Hello,

since /etc/crontab is purged of custom entries every time I update CRON jobs via OPNsense web UI (System-->Settings-->Cron) I moved the custom line to /usr/local/etc/cron.d/ as suggested in /etc/crontab:

# or /usr/local/etc/cron.d and follow the same format as
# /etc/crontab, see the crontab(5) manual page.

But it never runs. So what is crippled in OPNsense in comparison with pure FreeBSD?
Title: Re: CRON jobs in /usr/local/etc/cron.d are not run
Post by: cookiemonster on April 16, 2025, 10:44:59 AM
cron jobs via the GUI work fine for me. What is it that fails for you for those jobs ?
Title: Re: CRON jobs in /usr/local/etc/cron.d are not run
Post by: zemanek on April 16, 2025, 02:24:45 PM
@cookiemonster I'm afraid I don't understand the question. When CRON job defined in a file in /usr/local/etc/cron.d/ never runs it is not a failure to you? When it was in /var/cron/tabs/root, it worked.
Title: Re: CRON jobs in /usr/local/etc/cron.d are not run
Post by: franco on April 16, 2025, 02:43:21 PM
Create your own actions file, add description: and it will show up in Cron GUI. Done.

https://docs.opnsense.org/development/backend/configd.html


Cheers,
Franco
Title: Re: CRON jobs in /usr/local/etc/cron.d are not run
Post by: zemanek on April 16, 2025, 04:02:24 PM
Damn! Now I feel stupid. I forgot to add user column after moving it to system wide cron.d/.

Sorry.