like the following 
can you check and correct me if iam wrong
*******************************************************************
 . /home/paradigm/.profile 
 #!/bin/sh  
 #myrun.shell
 xapipgm=srvtst26.pl
 pgrep -f $xapipgm > /dev/null
 # runrc=$?
 # echo "Return Code is: $?"
 if [ $? -eq 0 ]
 then
 set `pgrep -f $xapipgm `
 echo "AHD XAPI Server ($xapipgm) Running with Process Id: $1"
 else 
 echo "AHD XAPI Server is now Started Running on 
`date`.">log/init/ahdxapi.init.$1$2$3.$4$5.log
 set `date '+%Y %m %d %H %M' `
 xapipgm=srvtst26.pl
 perl -w $xapipgm > log/init/ahdxapi.init.$1$2$3.$4$5.log 
2>log/init/ahdxapi.init.$1$2$3.$4$5.err
 #perl -w $4$5>log/init/ahdxapi.init
 fi
*******************************************************************************
-----Original Message-----
From: Ramprasad [mailto:[EMAIL PROTECTED]
Sent: Monday, 18 August 2003 1:02 PM
To: [EMAIL PROTECTED]; Vema Venkata
Cc: Trina Espinoza
Subject: Re: Cron problems


Vema Venkata wrote:
> Hi Floks
> 
> when i am trying to run the following script
> it is getting executed but when iam tryint to execute thru corntab it is not?can any 
> one suggest 
> 
> the script name is xapipgm.pl  
> *******************************************************************************
> #!/bin/sh  
> #myrun.shell
> xapipgm=srvtst26.pl
> pgrep -f $xapipgm > /dev/null
> # runrc=$?
> # echo "Return Code is: $?"
> if [ $? -eq 0 ]
> then
> set `pgrep -f $xapipgm `
> echo "AHD XAPI Server ($xapipgm) Running with Process Id: $1"
> else 
> echo "AHD XAPI Server is now Started Running on 
> `date`.">log/init/ahdxapi.init.$1$2$3.$4$5.log
> set `date '+%Y %m %d %H %M' `
> xapipgm=srvtst26.pl
> perl -w $xapipgm > log/init/ahdxapi.init.$1$2$3.$4$5.log 
> 2>log/init/ahdxapi.init.$1$2$3.$4$5.err
> #perl -w $4$5>log/init/ahdxapi.init
> fi
> ********************************************************************************corn 
> tab settings
> 
> ****************************************************************************
> 1-59 * * * * . /home/paradigm/.profile; 
> /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl  > 
> /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init...log>> 
> /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init...log
> 
> *****************************************************************************


doesnt seem to be a perl problem

well why dont you put '. /home/paradigm/.profile ' within your shell 
script else your shell may not get all the exported variables



You can right a better cron line ( Ofcourse replace $script and $logfile 
to the values )
* * * * * $script >>$logfile  2>&1

# Run every minute instead of all minutes from 1-59

now get the  read the $logfile ( after 1 minute ;-) ) and see if there 
were some errors



Ram







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to