Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Notifications - Windows Backup/NTBackup

Status
Not open for further replies.

markus97

Technical User
Apr 11, 2007
58
CA
Anyone know how I can configure ntbackup to send email notifications of the job logs or just an indication if the job was successful or failed?

Thanks
 
I am using this batch script which I got from the net once: You will need blat.exe and some backup.bks settings file. Also, the path to the data files needs to be correct. So some tuning to do...

You schedule this script to run when you want the backup to run.

============================

@echo off
setlocal

Rem get date into a variable so we can create good media name
for /F "usebackq delims=" %%i IN (`date /t`) DO set dt="%%ibackup media"


Rem Perform backup
C:\WINDOWS\system32\ntbackup.exe backup "@C:\Backup.bks" /n %dt% /d "some name" /v:no /r:no /rs:no /hc:eek:n /m normal /j "some name" /l:s /p "DLT" /um

Rem Set folder name containing backup log files
set fld=C:\Docume~1\administrator\Locals~1\Applic~1\Microsoft\Window~2\NTBackup\data\

Rem This dir command will list all log files sorted by date in bare format
set fcmd=dir "%fld%*.log" /OD /A-D /B

Rem set command will set lastf variable to the last file in set, i.e. the latest one
for /F "tokens=* delims= " %%i in ('%fcmd%') do set lastf=%fld%%%i

Rem Mail latest log file to us
c:\blat\blat.exe "%lastf%" -t some@address.com -s "Backup Report" -mime -server smtp.some.domain -f "some@senderaddress.com" -q
 
I use VBScript to do what you are asking.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top