Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Executing bash script with cron
« previous
next »
Print
Pages: [
1
]
Author
Topic: Executing bash script with cron (Read 3838 times)
guest32123
Guest
Executing bash script with cron
«
on:
February 19, 2022, 06:29:52 pm »
Hello
,
i would like to execute a bash/sh script with cron.
i made actions_bashscript.conf in /usr/local/opnsense/service/conf/actions.d/
File contains:
[load]
command:/usr/local/opnsense/scripts/shell/bash.sh
parameters:
type:script
message: Run bash script
description: Run bash script
After creating the file, I restarted configd with: service configd restart
Then I executed the file with configctl bashscript load. The output was [OK]
But the script didn't make a directory in /root/ for me.
if I run the script with /usr/local/opnsense/scripts/shell/bash.sh
It will create a directory
What do I miss?
Thanks in advance.
Logged
guest32123
Guest
Re: Executing bash script with cron
«
Reply #1 on:
February 19, 2022, 07:24:14 pm »
My bad, I think I placed this topic in the wrong section.
If someone can move it, please do
Logged
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: Executing bash script with cron
«
Reply #2 on:
February 19, 2022, 07:42:19 pm »
This section is fine. you can change "type" to "script_output and debug with stdout (echo).
Cheers,
Franco
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Executing bash script with cron
«
Reply #3 on:
February 19, 2022, 09:59:09 pm »
bash has debug options. See "set -x"
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
Executing bash script with cron