Hi all,
I've installed Restic and run it successfully from the command line in a bash script.
It runs successfully as I've done this in terminal as root:
Code
export B2_ACCOUNT_ID=""
export B2_ACCOUNT_KEY=""
export RESTIC_PASSWORD_FILE="/home/restic-password.txt"
I then run restic from terminal via my bash script using ./runResticBackup.sh and it works perfectly.
I then take that bash script and enter it into Scheduled Jobs in the OMV dashboard and run the job to test it.
It gives this output:
Bash
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/bashScripts/runResticBackup.sh 2>&1' with exit code '1': Fatal: unable to open B2 backend: Account ID ($B2_ACCOUNT_ID) is empty
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/bashScripts/runResticBackup.sh 2>&1' with exit code '1': Fatal: unable to open B2 backend: Account ID ($B2_ACCOUNT_ID) is empty in /usr/share/openmediavault/engined/rpc/cron.inc:175 Stack trace: #0 /usr/share/php/openmediavault/rpc/serviceabstract.inc(565): OMVRpcServiceCron->{closure}('/tmp/bgstatusjD...', '/tmp/bgoutputN2...') #1 /usr/share/openmediavault/engined/rpc/cron.inc(179): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure)) #2 [internal function]: OMVRpcServiceCron->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}
So what I take from that is this line Fatal: unable to open B2 backend: Account ID ($B2_ACCOUNT_ID) is empty and that means my variables I exported in the terminal are not being read by the Scheduled Jobs user.
How can I get these variables accessible to the Scheduled Jobs user so the bash script can run?
Thanks so much...