beter reeport

This commit is contained in:
Ste Vaidis 2022-12-24 23:18:43 +02:00
parent 78fddc8358
commit b5abb4e6b4

View File

@ -184,7 +184,8 @@ function umount() {
function send_mail() {
COPIED=$( cat ${LOG} | grep "Number of created files:" | awk {'print $5'} )
DELETED=$( cat ${LOG} | grep "Number of deleted files:" | awk {'print $5'} )
SUBJECT="${COPIED} files copied, ${DELETED} files deleted"
TRANSFERRED=$( cat ${LOG} | grep "Number of regular files transferred:" | awk {'print $6'} )
SUBJECT="${COPIED} files copied, ${DELETED} files deleted, ${TRANSFERRED} files transferred"
echo "Backup Report" | mutt -s $SUBJECT -F /etc/muttrc $MAIL_RECIPIENT -a $LOG
}