17 lines
642 B
Bash
17 lines
642 B
Bash
#!/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"
|
|
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
|
|
done
|
|
#echo -e ${STATS[@]}
|
|
echo -e ${STATS[@]} | mail -s "[counter] TEST aktuelle Aenderungen" wikis@admin.systemausfall.org
|
|
|