user defined cron jobs to survive reboot

Started by unixpgmr, March 06, 2020, 09:03:47 PM

Previous topic - Next topic
I created some custom scripts to monitor things such as who logs in, load average, temps, etc.  I set these up so they would send a warning to my discord server.  These scripts required root privs, so added them to the root crontab. They didn't survive a reboot.  Is there a way to add custom cron jobs that will survive a reboot or upgrade?  I know that we have nrpe plugin, but I don't want to have another server just to receive nrpe notifications.  This works without the headache or cost of another server running.

Hi,

Have a look at:

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

Of particular note is adding a "description" field which allows your custom actions to be added to the GUI under System: Settings: Cron where you can use it as required.


Cheers,
Franco

Thanks much. I will look at that. It didn't occur to me to use configd for custom cron scripts.

You may also define your cron jobs in "/etc/cron.d/crontab".