On Mon, Feb 27, 2012 at 12:26 PM, Amit Sharma <[email protected]> wrote:
>  Hi,
>
> I have written a following shell script:
>
> #!/bin/bash
> # Script to check exim mailq at a specified interval
> echo `date` >> /adminscripts/logs/eximcount
> echo `exim -bpc` >> /adminscripts/logs/eximcount
> if [ `exim -bpc` -gt 0 ]
> then
> cat /adminscripts/logs/eximcount |mail -s "Count of EXIM Mailq on Server"  
> [email protected]
> else
> exit 1
> fi
>
>
> The above runs fine manually, however when I try to run it through crontab 
> (as root), it DOES run but /adminscripts/logs/eximcount
> gets empty value. When I run it manually it is able to get the correct count 
> like 5, 10 etc.
>

make sure your scripts works when starting with 'env -'.

_______________________________________________
Ilugd mailing list
[email protected]
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to