check if string exists in file -crontab issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

check if string exists in file -crontab issue

Roshan
Hi,

 

I have a shell script(imp.sh) which I would like to execute based on a condition

 

If IMPORTGAIAGCICIFLAG is set to TRUE from application.properties file, the imp.sh should execute

 

45 17 * * * [ $(\grep "IMPORTGAIAGCICIFLAG=TRUE" /comptel/DNR/DNRTOOL/FILES/application.properties 2>/dev/null) ] && sh /home/oracle/imp.sh

 

On crontab it is not working, but when I execute the script in shell, it works.

Please advise.

ROshan
Reply | Threaded
Open this post in threaded view
|

Re: check if string exists in file -crontab issue

ErmanArslansOracleBlog
Administrator
What is written in cron log?

You may have a permission issue. (script execution, file read permission etc.)