
#!/bin/sh
# File	: dfm_delete_events.sh
# By	: Maarten.deBoer@atos.net & stephan-becker@atos.net, 140922
# Subject	: Script to delete DFM events. To clean / empty the DFM-database
#
PGM="`basename $0| cut -d\. -f1`"
VER="0.1"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"

touch ${TMP}

echo "`date` ${PGM} started" |tee -a ${LOG}

##/usr/bin/dfm event list -q -S 'Normal' -S 'Information' -S 'Warning' > ${TMP}
/usr/bin/dfm event list -q -S 'Normal' -S 'Information' > ${TMP}
echo "  `wc -l ${TMP}` lines will be deteled" | tee -a ${LOG}
cat ${TMP} | while read ID LINE
do
  echo ${ID}
  /usr/bin/dfm event delete $ID

done   # while

echo "`date` ${PGM} finished" |tee -a ${LOG}
rm ${TMP}
exit 0

