1
0
mirror of https://github.com/cmur2/munin-postfix.git synced 2024-11-18 12:56:17 +01:00
munin-postfix/syslog5mins
2012-01-09 21:07:28 +01:00

16 lines
367 B
Bash
Executable File

#!/bin/bash
if [ "$1" == "" ]; then
echo "No file given!"
exit 1
fi
for (( i = 4; i >= 0; i-- )) ; do
# In %_d the underscore is important since it demands `date`
# to pad with spaces (like syslog for e.g. "Jan 1" to "Jan 9")
# instead of zeros.
dstring=`LANG=C date -d "-$i min" +"%b %_d %R"`
#echo "Entries for '$dstring':"
grep "^$dstring:.. " $1
done