OPNsense
  • 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 2840 times)

unixpgmr

  • Newbie
  • *
  • Posts: 14
  • Karma: 1
    • View Profile
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: 17751
  • Karma: 1620
    • View Profile
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
    • View Profile
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
    • View Profile
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
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2