counter testen auf .old Datei

This commit is contained in:
age 2006-07-25 22:11:09 +00:00
parent 6eec5b7b00
commit 33a123e34a
3 changed files with 32 additions and 22 deletions

View file

@ -4,15 +4,20 @@ 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`
if [ -r ${LISTPATH}${list}/num ]; then
countnew=`cut -d ":" -f1 ${LISTPATH}${list}/num`
if [ -e ${LISTPATH}${list}/num.old ]; then
countold=`cut -d ":" -f1 ${LISTPATH}${list}/num.old`
else
cp ${LISTPATH}${list}/num ${LISTPATH}${list}/num.old
countold=0
fi
changes=$[${countnew}-${countold}]
STATS[$i]="\t${changes}\t${list}\n"
((i++))
cp ${list}/num ${list}/num.old
cp ${LISTPATH}${list}/num ${LISTPATH}${list}/num.old
fi
done
#echo -e ${STATS[@]}
## this mail is also counted :)
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" qmail@admin.systemausfall.org

View file

@ -3,14 +3,17 @@ set -e
SVNPATH="/data/repos/"
STATS[0]="svn Aenderungen:\n"
i=1
for svn in `ls ${SVNPATH}`; do
countnew=`cut -d " " -f1 ${svn}/db/current`
countold=`cut -d " " -f1 ${svn}/db/current.old`
for svn in `ls ${SVNPATH}`; do
countnew=`cut -d " " -f1 ${SVNPATH}${svn}/db/current`
if [ -e ${SVNPATH}${svn}/db/current.old ]; then
countold=`cut -d " " -f1 ${SVNPATH}${svn}/db/current.old`
else
countold=0
fi
changes=$[${countnew}-${countold}]
STATS[$i]="\t${changes}\t${svn}\n"
((i++))
cp ${svn}/db/current ${svn}/db/current.old
STATS[$i]="\t${changes}\t${svn}\n"
((i++))
cp ${svn}/db/current ${svn}/db/current.old
done
#echo -e ${STATS[@]}
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" svn@admin.systemausfall.org

View file

@ -1,17 +1,19 @@
#!/bin/sh
set -e
## this script counts wiki changes, done since the time it was last started
WIKIS="/data/moin/sites/"
STATS[0]="Auflistung der veraenderten Seiten je Wiki:\n"
STATS[0]="Veraenderte Seiten je Wiki, innerhalb der vergangenen Woche:\n"
i=1
for wiki in `ls $WIKIS`; do
countnew=`wc -l ${WIKIS}/${wiki}/edit-log | cut -d" " -f1`
countold=`wc -l ${WIKIS}/${wiki}/edit-log.old | cut -d" " -f1`
changes=$[${countnew}-${countold}]
STATS[$i]="\t${changes}\t${wiki}\n"
((i++))
#cp ${WIKIS}/${wiki}/edit-log ${WIKIS}/${wiki}/edit-log.old
countnew=`wc -l ${WIKIS}/${wiki}/edit-log | cut -d" " -f1`
if [ -e ${WIKIS}/${wiki}/edit-log.old ]; then
countold=`wc -l ${WIKIS}/${wiki}/edit-log.old | cut -d" " -f1`
else
countold=0
fi
changes=$[${countnew}-${countold}]
STATS[$i]="\t${changes}\t${wiki}\n"
((i++))
cp ${WIKIS}/${wiki}/edit-log ${WIKIS}/${wiki}/edit-log.old
done
#echo -e ${STATS[@]}
echo -e ${STATS[@]} | mail -s "[counter] TEST aktuelle Aenderungen" wikis@admin.systemausfall.org
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" wikis@admin.systemausfall.org