I am using OCI CLI in ubuntu to automate a couple of things using crontab.
While using and oci command,ex:
oci --help
I get a list of oci commands. However, as soon as I put it into a bash:
#!/bin/bash
oci --help
and do the crontab with log, I get the error message:
/home/ubuntu/lib/oracle-cli/bin/test: line 2: oci: command not found
Any ideas ?
2
Answers
When it opens a shell, cron will not inherit the environment variables (like
PATH
) that you use from the command prompt. You need to include the complete, explicit path to theoci
command in your script. You can find this from your command prompt with thewhich
command, as follows:This can be caused by one of the following reasons:
your active one.
installed the CLI.
To determine where the CLI is installed, run the
and
commands.
See this link ,it may help.
check this one too.