counter testen auf .old Datei
This commit is contained in:
parent
6eec5b7b00
commit
33a123e34a
3 changed files with 32 additions and 22 deletions
|
@ -4,15 +4,20 @@ LISTPATH="/data/lists/"
|
||||||
STATS[0]="Mailinglisten Verkehr:\n"
|
STATS[0]="Mailinglisten Verkehr:\n"
|
||||||
i=1
|
i=1
|
||||||
for list in `ls ${LISTPATH}`; do
|
for list in `ls ${LISTPATH}`; do
|
||||||
#for list in "/data/lists/svn-codekasten" do
|
if [ -r ${LISTPATH}${list}/num ]; then
|
||||||
if [ -r ${list}/num ]; then
|
countnew=`cut -d ":" -f1 ${LISTPATH}${list}/num`
|
||||||
countnew=`cut -d ":" -f1 ${list}/num`
|
if [ -e ${LISTPATH}${list}/num.old ]; then
|
||||||
countold=`cut -d ":" -f1 ${list}/num.old`
|
countold=`cut -d ":" -f1 ${LISTPATH}${list}/num.old`
|
||||||
|
else
|
||||||
|
cp ${LISTPATH}${list}/num ${LISTPATH}${list}/num.old
|
||||||
|
countold=0
|
||||||
|
fi
|
||||||
changes=$[${countnew}-${countold}]
|
changes=$[${countnew}-${countold}]
|
||||||
STATS[$i]="\t${changes}\t${list}\n"
|
STATS[$i]="\t${changes}\t${list}\n"
|
||||||
((i++))
|
((i++))
|
||||||
cp ${list}/num ${list}/num.old
|
cp ${LISTPATH}${list}/num ${LISTPATH}${list}/num.old
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
#echo -e ${STATS[@]}
|
#echo -e ${STATS[@]}
|
||||||
|
## this mail is also counted :)
|
||||||
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" qmail@admin.systemausfall.org
|
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" qmail@admin.systemausfall.org
|
||||||
|
|
|
@ -4,13 +4,16 @@ SVNPATH="/data/repos/"
|
||||||
STATS[0]="svn Aenderungen:\n"
|
STATS[0]="svn Aenderungen:\n"
|
||||||
i=1
|
i=1
|
||||||
for svn in `ls ${SVNPATH}`; do
|
for svn in `ls ${SVNPATH}`; do
|
||||||
countnew=`cut -d " " -f1 ${svn}/db/current`
|
countnew=`cut -d " " -f1 ${SVNPATH}${svn}/db/current`
|
||||||
countold=`cut -d " " -f1 ${svn}/db/current.old`
|
if [ -e ${SVNPATH}${svn}/db/current.old ]; then
|
||||||
|
countold=`cut -d " " -f1 ${SVNPATH}${svn}/db/current.old`
|
||||||
|
else
|
||||||
|
countold=0
|
||||||
|
fi
|
||||||
changes=$[${countnew}-${countold}]
|
changes=$[${countnew}-${countold}]
|
||||||
STATS[$i]="\t${changes}\t${svn}\n"
|
STATS[$i]="\t${changes}\t${svn}\n"
|
||||||
((i++))
|
((i++))
|
||||||
cp ${svn}/db/current ${svn}/db/current.old
|
cp ${svn}/db/current ${svn}/db/current.old
|
||||||
done
|
done
|
||||||
#echo -e ${STATS[@]}
|
#echo -e ${STATS[@]}
|
||||||
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" svn@admin.systemausfall.org
|
echo -e ${STATS[@]} | mail -s "[counter] aktuelle Aenderungen" svn@admin.systemausfall.org
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
## this script counts wiki changes, done since the time it was last started
|
|
||||||
WIKIS="/data/moin/sites/"
|
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
|
i=1
|
||||||
for wiki in `ls $WIKIS`; do
|
for wiki in `ls $WIKIS`; do
|
||||||
countnew=`wc -l ${WIKIS}/${wiki}/edit-log | cut -d" " -f1`
|
countnew=`wc -l ${WIKIS}/${wiki}/edit-log | cut -d" " -f1`
|
||||||
countold=`wc -l ${WIKIS}/${wiki}/edit-log.old | cut -d" " -f1`
|
if [ -e ${WIKIS}/${wiki}/edit-log.old ]; then
|
||||||
changes=$[${countnew}-${countold}]
|
countold=`wc -l ${WIKIS}/${wiki}/edit-log.old | cut -d" " -f1`
|
||||||
STATS[$i]="\t${changes}\t${wiki}\n"
|
else
|
||||||
((i++))
|
countold=0
|
||||||
#cp ${WIKIS}/${wiki}/edit-log ${WIKIS}/${wiki}/edit-log.old
|
fi
|
||||||
|
changes=$[${countnew}-${countold}]
|
||||||
|
STATS[$i]="\t${changes}\t${wiki}\n"
|
||||||
|
((i++))
|
||||||
|
cp ${WIKIS}/${wiki}/edit-log ${WIKIS}/${wiki}/edit-log.old
|
||||||
done
|
done
|
||||||
#echo -e ${STATS[@]}
|
#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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue