prikaz date-prosim o pomoc otazka na postfix
Jan Friedel
jf at devnull.cz
Thu Aug 9 11:09:25 CEST 2007
Ahoj,
On Thu, Aug 09, 2007 at 10:24:18AM +0200, Jaroslav Votruba wrote:
>
> >
> >MYDATE=$( date '+%b %e' )
> >
> >
> > Dan
> >
> >
> >
>
>
> mohl by mi nekdo vysvetlit ,proc mi to rve chybu?Viz nize,script je jeste
> nize
Chybi ti uvozovky.
pr. egrep ${MYMONTH} -> egrep -- "${MYMONTH}"
/honza
>
.
.
>
>
>
> #!/bin/sh
>
> MYDATE=$(date '+%b %e')
> MYMONTH=$(date '+%b')
> DATE=$(date +%d-%m-%Y)
>
>
> echo " "
>
> # denni vypis
> ZADEN=$(egrep ${MYDATE} /var/log/maillog | egrep blocked | wc -l)
> echo "Odmitnutych mailu za den ${DATE} je ${ZADEN}"
>
>
> # mesicni vypis
> (cat /var/log/maillog ; bzcat /var/log/maillog.[1-6].bz2) > /tmp/aa
> ZAMESIC=$(egrep ${MYMONTH} /tmp/aa | egrep blocked | wc -l)
> echo "Odmitnutych mailu za mesic ${MYMONTH} je ${ZAMESIC}"
>
> #podrobny vypis
> echo " "
> echo "Podrobny vypis za den " ${DATE}
> egrep ${MYDATE} /var/log/maillog |egrep blocked | awk -F blocked\
> using '{print $2}' | awk -F \; '{print $1}' | sort | uniq -c
>
> echo "-------------------------------"
> DNSD=$(egrep ${MYDATE} /var/log/maillog | grep "cannot find your
> hostname" | wc -l)
> echo ${DNSD}" " "Chybejici zaznam v DNS"
>
> echo "-------------------------------"
> NEZNAMYD=$(egrep ${MYDATE} /var/log/maillog | grep "User unknown " |
> wc -l)
> echo ${NEZNAMYD}" " "Neznamy uzivatel "
>
> echo "-------------------------------"
>
> echo " "
> echo "Podrobny vypis za mesic " ${MYMONTH}
> egrep ${MYMONTH} /tmp/aa |egrep blocked | awk -F blocked\ using
> '{print $2}' | awk -F \; '{print $1}' | sort | uniq -c
>
> echo "-------------------------------"
> DNSM=$(egrep ${MYMONTH} /tmp/aa | egrep "cannot find your hostname" |
> wc -l)
> echo ${DNSM}" " "Chybejici zaznam v DNS"
>
> echo "-------------------------------"
> NEZNAMYM=$(egrep ${MYMONTH} /tmp/aa | grep "User unknown " | wc -l)
> echo ${NEZNAMYM}" " "Neznamy uzivatel "
>
> echo "-------------------------------"
>
>
> rm /tmp/aa
>
> --
> FreeBSD mailing list (users-l at freebsd.cz)
> http://www.freebsd.cz/listserv/listinfo/users-l
More information about the Users-l
mailing list