Hi everyone!
I created a script that I will soon post in the guide section as soon as I finished all testing
My latest issue is running it throught scheduled jobs.
If I run it from cli using
/home/Script/test.sh
it works fine.
If I run it from scheduled jobs I recieve this error:
QuoteDisplay MoreFailed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin;
export LANG=C.UTF-8; export SHELL=/bin/sh;
sudo --shell --non-interactive --user=root -- /home/Script/Restart_downloader.sh 2>&1' with exit code '2':
/home/Script/Restart_downloader.sh: 7: /home/Script/Restart_downloader.sh: Syntax error: word unexpected (expecting ")")
Error #0:
OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export SHELL=/bin/sh; sudo --shell --non-interactive --user=root -- /home/Script/Restart_downloader.sh 2>&1' with exit code '2': /home/Script/Restart_downloader.sh: 7: /home/Script/Restart_downloader.sh: Syntax error: word unexpected (expecting ")") in /usr/share/openmediavault/engined/rpc/cron.inc:177
Stack trace:
#0 /usr/share/php/openmediavault/rpc/serviceabstract.inc(588): Engined\Rpc\Cron->Engined\Rpc\{closure}('/tmp/bgstatusEg...', '/tmp/bgoutput34...')
#1 /usr/share/openmediavault/engined/rpc/cron.inc(181): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
#2 [internal function]: Engined\Rpc\Cron->execute(Array, Array)
#3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
#4 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('execute', Array, Array)
#5 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('Cron', 'execute', Array, Array, 1)
#6 {main}
This is how I created the job:
I don't get why if I run the script from cli it work while if I run it from cronjob I recieve an error.
OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export SHELL=/bin/sh; sudo --shell --non-interactive --user=root -- /home/Script/Restart_downloader.sh 2>&1' with exit code '2': /home/Script/Restart_downloader.sh: 7: /home/Script/Restart_downloader.sh: Syntax error: word unexpected (expecting ")") in /usr/share/openmediavault/engined/rpc/cron.inc:177Is this a OMV bug?