Auswertung GhettoVCB

[code lang=“bash“]#!/bin/bash

# Vor wie viele Tagen lief GhettoVCB?
BACKLOG=1

echo „From: GhettoVCB “ >> /tmp/ghettovcb.$$
echo „To: ABC “ >> /tmp/ghettovcb.$$
echo „Subject: Datensicherung GhettoVCB“ >> /tmp/ghettovcb.$$

cat /var/log/ghettoVCB.log | grep -r ^`date –date=“$BACKLOG day ago“ +%Y-%m-%d` >> /tmp/ghettovcb.$$

echo >> /tmp/ghettovcb.$$

cat /var/log/ghettoVCB.log | grep -r ^`date –date=“$BACKLOG day ago“ +%Y-%m-%d` | grep Successfully >> /tmp/ghettovcb.$$

/usr/sbin/sendmail -t < /tmp/ghettovcb.$$ /bin/rm -f /tmp/ghettovcb.$$[/code]