It may be related to the path where cron executes the script, which may not
have the permissions required. Please correct me if i am wrong.

Thanks
Anuj

On Wed, Mar 11, 2009 at 9:38 PM, Nelson Serafica <[email protected]>wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Here is the contents of rate.sh
>
> #!/bin/bash
>
> l=`date +%Y-%m-%d.log`
> total=`cat $l | grep "forwarded?" | grep -v "injected" | wc -l`
>
> spam=`cat $l | grep "forwarded?false" | grep -v "injected" | wc -l`
> dropped=`cat $l | grep "will be closed" | wc -l`
> dropped2=`cat $l | grep "and is dropped" | wc -l`
>
> ham=`cat $l | grep "forwarded?true" | grep -v "injected" | wc -l`
> rejected=`cat $l | grep " rejected" | wc -l`
>
> date=`date +%l:%M\ %F`
> total=$(( $total+$rejected+$dropped+$dropped2))
> rejected=$(($rejected+$dropped+$dropped2))
> spamrate=$(($spam+$rejected))
> spamrate=$(echo "scale=2; $spamrate*100/$total" | bc)
> echo "0,,$spamrate,0,OK"
>
> Jeremiah Bess wrote:
> > Sounds like the shell that is running the rate.sh doesn't have the
> > variable set for your 99.08 value. Where is that variable set, in the
> > rate.sh file? If so, can you post the rate.sh here so we can look at it?
> >
> > Jeremiah E. Bess
> > Network Ninja, Penguin Geek, Father of four
> >
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkm4dZIACgkQUZICHAVQ58qT6ACeOjDeSkQWWp2gKX8O4NybPL6z
> skwAoJrV09x8vxqaUmhTsnrCGlCBr+Si
> =L9S3
> -----END PGP SIGNATURE-----
>
> >
>


Engineering is the art of making what you want from things you can get.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to