Re: xctl problem on script
Posted in 2001
Topics: General Discussion
The output:
Sorry
INFORMIXDIR is not the problem.
Thanks
In article <93co8j$ngd$1@nnrp1.deja.com>,
William Rice <ricew@operamail.com> wrote:
> INFORMIXDIR is not set, my guess would be it should be set to
> /usr/informix.
>
> If this is not the problem, redirect standard error and standard out
to
> a file, and post what that file contains...
>
> Will
>
> In article <93cmj2$lta$1@nnrp1.deja.com>,
> mazafar4@my-deja.com wrote:
> > The complete script is this:
> > INFORMIXSERVER=tcms; export INFORMIXSERVER> > toolsdir=/usr/informix/bin; export toolsdir
> > allusers=`$toolsdir/xctl $toolsdir/onstat -u | grep informix | wc -l
> |
> > awk ' {print $1 }'`
> > ##XCTL="$toolsdir/xctl"; export XCTL
> > ##ONSTAT="$toolsdir/onstat"; export ONSTAT
> > ##allusers=`$XCTL $ONSTAT -u | grep informix | wc -l | awk ' {print
> > $1 }'`
> > if [ $allusers -gt 1 ]
> > then
> > echo "Informix"
> > else
> > echo "Sorry"
> > fi
> >
> > In article <93clcp$kr2$1@nnrp1.deja.com>,
> > William Rice <ricew@operamail.com> wrote:
> > > Are you sure you are setting all of the environment variables
> properly
> > > in the script?. INFORMIXDIR, and INFORMIXSERVER need to be set.
> > >
> > > What errors do you get? The exact error output would be quite
> > helpful.
> > >
> > > Will
> > >
> > > In article <93cju3$jjj$1@nnrp1.deja.com>,
> > > mazafar4@my-deja.com wrote:
> > > > I have a script which will run across the co-servers with the
> > > informix
> > > > xctl command. The script is running fine at the command prompt;
> but
> > > it
> > > > fails if i run same when I put it on the crontab.
> > > > Script:
> > > > allusers=`/usr/informix/bin/xctl /usr/informix/bin/onstat -u |
> grep
> > > > informix | wc -l | awk ' { print $1 }'`
> > > > echo $allusers
> > > >
> > > > Will anyone please help me out. I tried even exporting the xctl
> > > command
> > > > also; but failed.
> > > >
> > > > Thanks
> > > >
> > > > Sent via Deja.com
> > > > http://www.deja.com/
> > > >
> > >
> > > Sent via Deja.com
> > > http://www.deja.com/
> > >
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
in the script do
$toolsdir/xctl $toolsdir/onstat -u
and post that output.
In article <93coru$o3m$1@nnrp1.deja.com>,
mazafar4@my-deja.com wrote:
> The output:
> Sorry
>
> INFORMIXDIR is not the problem.
> Thanks
> In article <93co8j$ngd$1@nnrp1.deja.com>,
> William Rice <ricew@operamail.com> wrote:
> > INFORMIXDIR is not set, my guess would be it should be set to
> > /usr/informix.
> >
> > If this is not the problem, redirect standard error and standard
out
> to
> > a file, and post what that file contains...
> >
> > Will
> >
> > In article <93cmj2$lta$1@nnrp1.deja.com>,
> > mazafar4@my-deja.com wrote:
> > > The complete script is this:
> > > INFORMIXSERVER=tcms; export INFORMIXSERVER> > > toolsdir=/usr/informix/bin; export toolsdir
> > > allusers=`$toolsdir/xctl $toolsdir/onstat -u | grep informix | wc
-l
> > |
> > > awk ' {print $1 }'`
> > > ##XCTL="$toolsdir/xctl"; export XCTL
> > > ##ONSTAT="$toolsdir/onstat"; export ONSTAT
> > > ##allusers=`$XCTL $ONSTAT -u | grep informix | wc -l | awk '
{print
> > > $1 }'`
> > > if [ $allusers -gt 1 ]
> > > then
> > > echo "Informix"
> > > else
> > > echo "Sorry"
> > > fi
> > >
> > > In article <93clcp$kr2$1@nnrp1.deja.com>,
> > > William Rice <ricew@operamail.com> wrote:
> > > > Are you sure you are setting all of the environment variables
> > properly
> > > > in the script?. INFORMIXDIR, and INFORMIXSERVER need to be
set.
> > > >
> > > > What errors do you get? The exact error output would be quite
> > > helpful.
> > > >
> > > > Will
> > > >
> > > > In article <93cju3$jjj$1@nnrp1.deja.com>,
> > > > mazafar4@my-deja.com wrote:
> > > > > I have a script which will run across the co-servers with the
> > > > informix
> > > > > xctl command. The script is running fine at the command
prompt;
> > but
> > > > it
> > > > > fails if i run same when I put it on the crontab.
> > > > > Script:
> > > > > allusers=`/usr/informix/bin/xctl /usr/informix/bin/onstat -u
|
> > grep
> > > > > informix | wc -l | awk ' { print $1 }'`
> > > > > echo $allusers
> > > > >
> > > > > Will anyone please help me out. I tried even exporting the
xctl
> > > > command
> > > > > also; but failed.
> > > > >
> > > > > Thanks
> > > > >
> > > > > Sent via Deja.com
> > > > > http://www.deja.com/
> > > > >
> > > >
> > > > Sent via Deja.com
> > > > http://www.deja.com/
> > > >
> > >
> > > Sent via Deja.com
> > > http://www.deja.com/
> > >
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
I tried everything; but it is not giving the correct output only from
crontab.
In article <93cppt$p22$1@nnrp1.deja.com>,
William Rice <ricew@operamail.com> wrote:
> in the script do
> $toolsdir/xctl $toolsdir/onstat -u
>
> and post that output.
>
> In article <93coru$o3m$1@nnrp1.deja.com>,
> mazafar4@my-deja.com wrote:
> > The output:
> > Sorry
> >
> > INFORMIXDIR is not the problem.
> > Thanks
> > In article <93co8j$ngd$1@nnrp1.deja.com>,
> > William Rice <ricew@operamail.com> wrote:
> > > INFORMIXDIR is not set, my guess would be it should be set to
> > > /usr/informix.
> > >
> > > If this is not the problem, redirect standard error and standard
> out
> > to
> > > a file, and post what that file contains...
> > >
> > > Will
> > >
> > > In article <93cmj2$lta$1@nnrp1.deja.com>,
> > > mazafar4@my-deja.com wrote:
> > > > The complete script is this:
> > > > INFORMIXSERVER=tcms; export INFORMIXSERVER> > > > toolsdir=/usr/informix/bin; export toolsdir
> > > > allusers=`$toolsdir/xctl $toolsdir/onstat -u | grep informix |
wc
> -l
> > > |
> > > > awk ' {print $1 }'`
> > > > ##XCTL="$toolsdir/xctl"; export XCTL
> > > > ##ONSTAT="$toolsdir/onstat"; export ONSTAT
> > > > ##allusers=`$XCTL $ONSTAT -u | grep informix | wc -l | awk '
> {print
> > > > $1 }'`
> > > > if [ $allusers -gt 1 ]
> > > > then
> > > > echo "Informix"
> > > > else
> > > > echo "Sorry"
> > > > fi
> > > >
> > > > In article <93clcp$kr2$1@nnrp1.deja.com>,
> > > > William Rice <ricew@operamail.com> wrote:
> > > > > Are you sure you are setting all of the environment variables
> > > properly
> > > > > in the script?. INFORMIXDIR, and INFORMIXSERVER need to be
> set.
> > > > >
> > > > > What errors do you get? The exact error output would be quite
> > > > helpful.
> > > > >
> > > > > Will
> > > > >
> > > > > In article <93cju3$jjj$1@nnrp1.deja.com>,
> > > > > mazafar4@my-deja.com wrote:
> > > > > > I have a script which will run across the co-servers with
the
> > > > > informix
> > > > > > xctl command. The script is running fine at the command
> prompt;
> > > but
> > > > > it
> > > > > > fails if i run same when I put it on the crontab.
> > > > > > Script:
> > > > > > allusers=`/usr/informix/bin/xctl /usr/informix/bin/onstat -u
> |
> > > grep
> > > > > > informix | wc -l | awk ' { print $1 }'`
> > > > > > echo $allusers
> > > > > >
> > > > > > Will anyone please help me out. I tried even exporting the
> xctl
> > > > > command
> > > > > > also; but failed.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Sent via Deja.com
> > > > > > http://www.deja.com/
> > > > > >
> > > > >
> > > > > Sent via Deja.com
> > > > > http://www.deja.com/
> > > > >
> > > >
> > > > Sent via Deja.com
> > > > http://www.deja.com/
> > > >
> > >
> > > Sent via Deja.com
> > > http://www.deja.com/
> > >
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
OK, in my experience if something works from the command line, but not
in cron, the problem is always either environment variables, or not
having #!/usr/bin/ksh(or whatever shell you are expecting the script
to run in)
I have seen xctl onstat commands in multiple shell scripts running out
of cron with no issues.
would you place the following commands at the bottom of your shell
script, run it out of cron and post or email the output.
xctl onstat -u
echo "informixdir $INFORMIXDIR"
echo "informixserver $INFORMIXSERVER"
it is difficult to troubleshoot the issue without knowing what xctl
onstat -u does output when run out of cron.
Will
In article <93d10b$5r$1@nnrp1.deja.com>,
mazafar4@my-deja.com wrote:
> I tried everything; but it is not giving the correct output only from
> crontab.
>
> In article <93cppt$p22$1@nnrp1.deja.com>,
> William Rice <ricew@operamail.com> wrote:
> > in the script do
> > $toolsdir/xctl $toolsdir/onstat -u
> >
> > and post that output.
> >
> > In article <93coru$o3m$1@nnrp1.deja.com>,
> > mazafar4@my-deja.com wrote:
> > > The output:
> > > Sorry
> > >
> > > INFORMIXDIR is not the problem.
> > > Thanks
> > > In article <93co8j$ngd$1@nnrp1.deja.com>,
> > > William Rice <ricew@operamail.com> wrote:
> > > > INFORMIXDIR is not set, my guess would be it should be set to
> > > > /usr/informix.
> > > >
<SNIP>
Sent via Deja.com
http://www.deja.com/