A service of Daily Data, Inc.
Contact Form

User Tools

Site Tools


other:networking:opnsense:cron-jobs
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


other:networking:opnsense:cron-jobs [2020/01/11 19:17] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== opnSense Cron Jobs ======
 +
 +Basically, it uses [[http://www.manpagez.com/man/8/configd/|configd]], so you have to create a service definition for your new script.
 +<code>
 +cd /usr/local/opnsense/service/conf/actions.d
 +</code>
 +
 +Create a file with the name //actions_NAME.conf//, where //NAME// is something meaningful to you. The file should have a basic win ini format, with the action needed, then a bunch of lines describing what to do.
 +
 +Example of a file named actions_updatedns.conf:
 +<file name=actions_updatedns.conf>
 +[reload]
 +command:/root/updateDNS
 +parameter:
 +type:script
 +message:update Daily Data DNS
 +description:Update Daily Data DNS
 +</file>
 +
 +Now that you have added a new config, you need to reload configd so it will read it:
 +<code>
 +service configd restart
 +</code>
 +And, test that you did everything right
 +<code>
 +configctl updatedns reload
 +</code>
 +the script /root/updateDNS will be run. You can create multiple actions (stop,start) in the same file with different scripts and/or parameters.
 +
 +Once this is done, the string after message (or description, I don't know which) will show up as a possible cron job in the opnSense GUI
 +
 +The log files are stored in /var/log/configd.log
 +
 +==== Bibliography ====
 +
 +  * [[https://docs.opnsense.org/development/backend/configd.html]]
 +  * [[https://docs.opnsense.org/development/backend.html]]
 +  * [[https://forum.opnsense.org/index.php?topic=2263.0]]
 +  * [[http://www.manpagez.com/man/8/configd/]]
  
other/networking/opnsense/cron-jobs.txt · Last modified: by 127.0.0.1