Email notification for NTBackup
We use NTBackup at various sites / on several machines to perform data backups. It may not be the best tool, but it has the big advantage of coming bundled with old versions of Windows.
Whereas it usually fits the job nicely, it lacks an essential feature: email notification.
In this How-To we’re going to use Blat and Eventtriggers to generate an email notification that will allow us to monitor NTBackup.
1 – Get Blat from http://www.blat.net/.
Blat is a WIndows command line tool that allows sending email.
2 – We’ve put the Blat folder at the root of our C: drive: C:\Blat306. The executable is in C:\Blat306\full, it’s simply called blat.exe.
3 – Create a folder called BackupScript on your C: drive
4 – Copy / paste the following command lines in a text file, customize it (recipient, sender, SMTP server) and save it as C:\BackupScript\email_log.bat
cd “C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data”
FOR /F %%i IN (‘DIR /B /O:-D *.log’) DO (
copy “%%i” C:\BackupScript\latest.txt
c:\blat306\full\blat.exe c:\BackupScript\latest.txt -to email@example.com -subject “NTBackup from site/server name” -server your.smtp.com -f firstname.lastname@example.org
This script makes a copy of the latest NTBackup log file (make sure the location of said log files is correct) into C:\BackupScript and uses Blat to send it by email.
5 – We Eventtrigger to monitor NTBackup entries in Windows Events. Some info about Eventtriggers can be found here.
Open a command prompt and type:
eventtriggers /create /tr “NTBackup” /so ntbackup /d “NTBackup monitoring” /tk “C:\backupScript\email_log.bat”