#!/bin/sh set -e LISTPATH="/data/lists/" STATS[0]="Mailinglisten Verkehr:\n" i=1 for list in `ls ${LISTPATH}`; do #for list in "/data/lists/svn-codekasten" do if [ -r ${list}/num ]; then countnew=`cut -d ":" -f1 ${list}/num` countold=`cut -d ":" -f1 ${list}/num.old` changes=$[${countnew}-${countold}] STATS[$i]="\t${changes}\t${list}\n" ((i++)) cp ${list}/num ${list}/num.old fi done #echo -e ${STATS[@]} echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" qmail@admin.systemausfall.org