[BlueOnyx:03076] Re: CCED problem?
Greg Kuhnert
greg.kuhnert at theanchoragesylvania.com
Thu Dec 10 18:26:14 -05 2009
Hi All.
Michael Stauber wrote:
> Please create a script on your server (name it /root/oidlist.sh) and
> put the
> following codein it:
>
> ---Start---
> #!/bin/bash
> LAST=-1
> MIN=-1
>
> for X in `ls /usr/sausalito/codb/objects/ | sort -n`
> do
> MYNEXT=$(( $LAST + 1 ))
> if [ $MYNEXT -eq $X ]
> then
> LAST=$X
> else
> if [ $LAST -ge 1 ]
> then
> if [ $MIN -eq $LAST ]
> then
> echo -n $LAST,
> else
> echo -n $MIN-$LAST,
> fi
> fi
> LAST=$X
> MIN=$X
> fi
> done
> if [ $MYNEXT -lt $X ]
> then
> echo $LAST
> fi
> echo ""
> echo "/usr/sausalito/codb/codb.oids reports:"
> cat /usr/sausalito/codb/codb.oids
> echo ""
> --End--
>
> That's everything between "---Start---" and "---End---". Then make that script
> executeable (chmod 700 /root/oidlist.sh) and run it as root. Report back the
> output that it generates.
>
> That might help to diagnose this further.
>
The above script was based on an early prototype that I was working on
with David Booth & Michael. I later found a problem with some of the
output in some circumstances. The version below has a small tweak to fix
the problem. Can I encourage you to use this version.
Regards,
Greg.
---Start---
#!/bin/bash
LAST=-1
MIN=-1
for X in `ls /usr/sausalito/codb/objects/ | sort -n`
do
MYNEXT=$(( $LAST + 1 ))
if [ $MYNEXT -eq $X ]
then
LAST=$X
else
if [ $LAST -ge 1 ]
then
if [ $MIN -eq $LAST ]
then
echo -n $LAST,
else
echo -n $MIN-$LAST,
fi
fi
LAST=$X
MIN=$X
fi
done
if [ $MYNEXT -lt $X ]
then
echo -n $LAST
else
echo -n $MIN-$LAST
fi
echo ""
echo "/usr/sausalito/codb/codb.oids reports:"
cat /usr/sausalito/codb/codb.oids
echo ""
--End--
More information about the Blueonyx
mailing list