Log in as the user you want to be when the script runs.
run crontab -e to get that user's own crontab
add the job to that crontab and see what happens. Obviously if you are already doing this then I am not helping very much here...
I am guessing that it *may* be a permissions thing.
Also consider doing the rename in the 'get' command in ftp.....
EG: get fname dir1/dir2/fname
thanks for the reply...
I am already using the same login for cron and running it from console.
what i mean to say is when I do "./script_name" from the console .. it gives me proper result.
also one more thing is that there is no problem with ftp.
coz i m already getting the .gz file on my local server.
I am assuming that the problem is with the command "gzip -dcf ......"
Please some 1 help me....
I stucked in great production issue coz of this :-((
after running gzip -d on a ooi.gz file you should get ooi
I think it would be better to simply gzip -d your file and then mv it to the required filename and directory rather than redirecting the gzip output to your new location..
if [ -f "$localpath/$file" ]
then
# generate the filename without the .gz
export $fileunzipped = `echo $file | sed 's/.gz//' #unzip the .gz file
gzip -dcf $localpath/$file #move the unzipped file to the new location
mv $localpath/$fileunzipped $localpath/$TELEXISTable.dat
else
ErrorMessage="E2E - uploaded $TELEXISTable file $file is empty"
echo "$ToolName : $ErrorMessage"
fi
I take your point about looking at the faqs but I not too sure how I have created a multiple thread. I replied to a question and realised I had made a syntax error and so I corrected it. I am happy to be proved wrong but....
thanks for all your suggestions .. but the problem was still persists.. untill I did a very little change... I m still surprized why any1 including me and u cundn't remeber this..
so the soln comes here ... i just changed the gzip to the abolute path ie /usr/contrib/bin/gzip -dcf $localpath/$file > $localpath/$TELEXISTable.dat
now my old scripts too is working file... I already know its always a better way to use absolue path while dealing with crons... but.............i have to waste my 3 days ...