1753808 Members
7553 Online
108805 Solutions
New Discussion юеВ

Re: Cron Job Issue

 
SOLVED
Go to solution
Horia Chirculescu
Honored Contributor

Re: Cron Job Issue

PATH=/usr/sbin:$PATH:/sbin:/home/root:/usr/local/bin:$JAVA_HOME


Not good enough...


As the user you are running "manually" the script and it is working, do

set

and copy PATH line


Then open your script and past the line there (delete this line)

I believe the only problem is with gzip but just to be sure, add the correct PATH variable as above.

Horia.
Best regards from Romania,
Horia.
Horia Chirculescu
Honored Contributor

Re: Cron Job Issue

"ipaddress "

I assume it is an IP address, not some variable?

Horia.
Best regards from Romania,
Horia.
Jupinder Bedi
Respected Contributor

Re: Cron Job Issue

you can set the path by using set command as follows


set pathname

and than try

Good luck
All things excellent are as difficult as they are rare
Johnson Punniyalingam
Honored Contributor

Re: Cron Job Issue

also it would be better if you can / direct the output for your script by crontab to "some logs" like >> /tmp/daily.log -> it can capture of the execution and we narrow down the problem

>>IP address<< as per IP attachment have exculded, becoz its confidential ..?
Problems are common to all, but attitude makes the difference
shameemsoft
Frequent Advisor

Re: Cron Job Issue

Thanks for your response.

I removed IP & server name from the script and uploaded to ITRC :)

If I set a path using set command, will it update the existing path configuration? It is production host. Thats why i would like to reconfirm with you guys.

Thanks in Advance
Shameem



Johnson Punniyalingam
Honored Contributor

Re: Cron Job Issue

if you run manually the script run as per your earlier post,

can we redirect to a log file to capture the output of your script while execution in crontab.
so that we will all know what causing the actual problem. Guess we are all shooting in the dark room.
Problems are common to all, but attitude makes the difference
shameemsoft
Frequent Advisor

Re: Cron Job Issue

Thanks Johnson.

I tried with that option...find the log output

#cat /tmp/log.out
Waiting until tar is complete ...
Tar completed successfully
Waiting until gzip is complete ...
Gzip completed successfully

tar & zip is completed with 0 bytes.. if i run manually at same time, some files exists in zip.

Kindly clarify on this

Thanks in Advance
Shameem
Yallappa
Occasional Advisor

Re: Cron Job Issue

Create to different script one for data collection and another for zip and transfer. And add two different entry in cron with sufficient time between them.
Horia Chirculescu
Honored Contributor

Re: Cron Job Issue

Have you set the PATH variable like this:

>As the user you are running "manually" the script and it is working, do

set

and copy PATH line into your SCRIPT.

Please re-attach the modified script here.

Horia
Best regards from Romania,
Horia.
Johnson Punniyalingam
Honored Contributor

Re: Cron Job Issue

>>>#cat /tmp/log.out
Waiting until tar is complete ...
Tar completed successfully
Waiting until gzip is complete ...
Gzip completed successfully<<<

as long as i see from above. time taken "tar" is too short. and between you can "use " sleep command optins

man sleep

"sleep - suspend execution for an interval"
Problems are common to all, but attitude makes the difference