Login  Register

check if string exists in file -crontab issue

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

check if string exists in file -crontab issue

Roshan
1294 posts
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
| More
Print post
Permalink

Re: check if string exists in file -crontab issue

ErmanArslansOracleBlog
Administrator
5727 posts
What is written in cron log?

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