Send mail report only if incrementals where deleted.
This commit is contained in:
parent
2ac3d7cf88
commit
f972e46012
|
@ -31,15 +31,17 @@ for client in ${CONFDIR}/*; do
|
||||||
echo "Deletion of ${backupname}/${inc#${INCDIR}/${backupname}/} started at ${start}." >> $tmplog
|
echo "Deletion of ${backupname}/${inc#${INCDIR}/${backupname}/} started at ${start}." >> $tmplog
|
||||||
# We use rsync to delete since it is faster than rm!
|
# We use rsync to delete since it is faster than rm!
|
||||||
rsync -a --delete ${emptydir}/ $inc
|
rsync -a --delete ${emptydir}/ $inc
|
||||||
rm -r $inc
|
rmdir $inc
|
||||||
stop=$(date --rfc-3339=seconds)
|
stop=$(date --rfc-3339=seconds)
|
||||||
echo "Deletion of ${backupname}/${inc#${INCDIR}/${backupname}/} ended at ${stop}." >> $tmplog
|
echo "Deletion of ${backupname}/${inc#${INCDIR}/${backupname}/} ended at ${stop}." >> $tmplog
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
# Save tmplog to global log.
|
|
||||||
cat $tmplog >> $LOGFILE
|
# Send mail report only if incrementals where deleted.
|
||||||
# Send mail report.
|
if [ -s $tmplog ]; then
|
||||||
< $tmplog mailx -s "[info] EvoBackup - deletion of obsolete incrementals" $MAIL_TO
|
# Save tmplog to global log & send mail.
|
||||||
|
cat $tmplog >> $LOGFILE
|
||||||
|
< $tmplog mailx -s "[info] EvoBackup - deletion of obsolete incrementals" $MAIL_TO
|
||||||
|
fi
|
||||||
# Cleaning
|
# Cleaning
|
||||||
rm -rf $tmpdir $emptydir
|
rm -rf $tmpdir $emptydir $tmplog
|
||||||
rm $tmplog
|
|
Loading…
Reference in a new issue