Maybe someone whose good at shell scripting could have a go at this
admin:qnap@blah.com:mail.blah.com:25
#!/bin/sh
# Header Stuff
MAILTO="admin@blah.com"
TO="Admin <admin@blah.com>"
FROM="QNAP <qnap@blah.com>"
SUBJECT="RSnapshot Log"
# Program
MAIL="/usr/sbin/ssmtp"
#logfile="/var/log/rsnapshot.log"
# Temporary Files MAILFILE="/tmp/TMPMAIL"
# Build Mail
echo "TO: $TO" > $MAILFILE
echo "FROM: $FROM" >> $MAILFILE
echo "SUBJECT: $SUBJECT" >> $MAILFILE
echo "" >> $MAILFILE
echo "Testing" >> $MAILFILE
# Send Mail
$MAIL $MAILTO < $MAILFILE
# Remove Temporary Files
rm -rf $MAILFILE
0 0 * * * /share/MD0_DATA/System/rsnapshot_log.sh
#!/bin/sh
# Header Stuff
LOG_FILE="/opt/var/log/rsnapshot"
TMP_LOG_FILE="/tmp/rsnapshot_log.log"
MAIL_FILE="/tmp/rsnapshot_log.mail"
MAIL_TO="my@email.com"
MAIL_HEADER_TO="Me <my@email.com>"
MAIL_HEADER_FROM="QNAP <qnap@email.com>"
MAIL_HEADER_SUBJECT="RSnapshot Log"
MAIL="/usr/sbin/ssmtp"
# Extract Todays Log ( format 30/Mar/2006 )
fgrep `date +"%d/%b/%Y"` $LOG_FILE > $TMP_LOG_FILE
# Build Mail
{
echo "TO: $MAIL_HEADER_TO"
echo "FROM: $MAIL_HEADER_FROM"
echo "SUBJECT: $MAIL_HEADER_SUBJECT"
echo ""
echo "Backup Report on `date`"
egrep "completed|ERROR" $TMP_LOG_FILE
echo ""
echo "Disk Usage:"
/opt/bin/rsnapshot du
echo ""
/opt/bin/df -h
echo ""
echo "Full Log:"
echo ""
cat $TMP_LOG_FILE
} > $MAIL_FILE
# Send Mail
$MAIL $MAIL_TO < $MAIL_FILE
# Remove Temporary Files
rm -rf $MAIL_FILE $TMP_LOG_FILE
55 23 * * * /share/MD0_DATA/System/rsnapshot_log.sh
I hope one day rsnapshot will be included in the QNAP firmware. Being able to step back in time and recover a specific version of a file is extremely useful.
Why do I have to use MD0_DATA when I can see the files when I go to /share/DocumentControl? Why does the backup contain "QNAP1\share\MD0_DATA\DocumentControl" directory instead of simply "DocumentControl"? I do understand that its giving the fully qualified path, but it's a lot of nesting that, I find to be inconvenient and unnecessary. Is there any way to prevent this?
Return to Remote Replication/ Disaster Recovery
Users browsing this forum: No registered users and 2 guests