Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
20.1 Legacy Series
»
user defined cron jobs to survive reboot
« previous
next »
Print
Pages: [
1
]
Author
Topic: user defined cron jobs to survive reboot (Read 2833 times)
unixpgmr
Newbie
Posts: 14
Karma: 1
user defined cron jobs to survive reboot
«
on:
March 06, 2020, 09:03:47 pm »
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.
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: user defined cron jobs to survive reboot
«
Reply #1 on:
March 08, 2020, 08:49:33 am »
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
Logged
unixpgmr
Newbie
Posts: 14
Karma: 1
Re: user defined cron jobs to survive reboot
«
Reply #2 on:
March 09, 2020, 08:03:16 pm »
Thanks much. I will look at that. It didn't occur to me to use configd for custom cron scripts.
Logged
Michel89
Newbie
Posts: 3
Karma: 0
Re: user defined cron jobs to survive reboot
«
Reply #3 on:
March 10, 2020, 12:52:50 am »
You may also define your cron jobs in "/etc/cron.d/crontab".
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
20.1 Legacy Series
»
user defined cron jobs to survive reboot