OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: dcol on August 17, 2021, 12:46:05 am

Title: [Feature Request]
Post by: dcol on August 17, 2021, 12:46:05 am
Didn't see anywhere in the forums for feature requests. Which can be another feature request

I would like to be able to add a custom Cron job in the WebGUI. Just a simple run this command on this schedule. Maybe it's already there. I couldn't find it.
Title: Re: [Feature Request]
Post by: Greelan on August 17, 2021, 12:59:25 am
You can’t add a custom cron command via the GUI but you can do it via CLI and have it appear in the GUI as an option to schedule in a cron job: http://kb.unixservertech.com/other/networking/opnsense/cron-jobs
Title: Re: [Feature Request]
Post by: dcol on August 17, 2021, 02:04:19 am
I saw that and tried, but does not work for me. Not sure what to put in the action file. When I copied it using my file, it didn't work and the configctl showed no action found. I did the service reset and saw the Cron job in the list but it never executes. I set the permissions on the file. Would be so much easier just to have a custom entry on the Cron screen in the GUI
Title: [Feature Request]
Post by: Greelan on August 17, 2021, 04:15:57 am
You might find the examples here helpful: https://forum.opnsense.org/index.php?topic=18865.msg86224#msg86224
Title: Re: [Feature Request]
Post by: cookiemonster on August 17, 2021, 05:01:38 pm
I saw that and tried, but does not work for me. Not sure what to put in the action file. When I copied it using my file, it didn't work and the configctl showed no action found. I did the service reset and saw the Cron job in the list but it never executes. I set the permissions on the file. Would be so much easier just to have a custom entry on the Cron screen in the GUI
That link seems to have what you need. I think you have an APU too. Shout if you want a hand with that. I can test it for you on mine.
P.s. there are two files. One with the actions and the other with the setup for the GUI
Title: Re: [Feature Request]
Post by: dcol on August 18, 2021, 08:55:02 pm
 Very similar to the script I was using. I will try that script tonight.
So what would the configctl test be with this script?
Thanks
Title: Re: [Feature Request]
Post by: cookiemonster on August 18, 2021, 10:30:44 pm
It is a simple service configuration without full service actions, I.e. no functions.
I've just tested the line doing the business and does what it needs to do for an external check.
Title: Re: [Feature Request]
Post by: dcol on August 18, 2021, 11:10:40 pm
I installed the cron job. I do see it run in the backend logs every 10 minutes and returning exit status 126, whatever that implies. I assume it is working. I do not see any console messages as the script implies.
Title: Re: [Feature Request]
Post by: dcol on August 18, 2021, 11:23:23 pm
My Bad. Forgot to set permissions on ping_check.sh. Getting broadcast message now. Thanks