prikaz date-prosim o pomoc otazka na postfix

Jaroslav Votruba jaroslav.votruba at keytec.cz
Thu Aug 9 10:24:18 CEST 2007


>
> MYDATE=$( date '+%b %e' )
>
>
> 					Dan
>
>
>   


mohl by mi nekdo vysvetlit ,proc mi to rve chybu?Viz nize,script je jeste nize

druha vec, jak je to v bashi s poli,existuji,ale netusim jak dobre a 
jake maji omezeni.Je to zbytecnost,ale chtel bych si jen zamenit nazev 
mesice Aug na cesky nazvy.
Pokud to jde pres pole,mohli by jste mi ukazat priklad?
Dekuji

egrep: 9: No such file or directory
Odmitnutych mailu za den 09-08-2007 je 301
Odmitnutych mailu za mesic Aug je 4313

Podrobny vypis za den  09-08-2007
egrep: 9: No such file or directory
  24  bl.spamcop.net
 160  cbl.abuseat.org
  12  combined.njabl.org
   1  dnsbl.ahbl.org
  91  dnsbl.sorbs.net
  12  list.dsbl.org
   1  sbl-xbl.spamhaus.org
-------------------------------
egrep: 9: No such file or directory
13    Chybejici zaznam v DNS
-------------------------------
egrep: 9: No such file or directory
37    Neznamy uzivatel
-------------------------------

Podrobny vypis za mesic  Aug
 217  bl.spamcop.net
2281  cbl.abuseat.org
 308  combined.njabl.org
   2  dnsbl.ahbl.org
1470  dnsbl.sorbs.net
  34  list.dsbl.org
   1  sbl-xbl.spamhaus.org
-------------------------------
226    Chybejici zaznam v DNS
-------------------------------
330    Neznamy uzivatel
-------------------------------






#!/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



More information about the Users-l mailing list