We help IT Professionals succeed at work.

Is it possible to provide email notification using NTBackup?

HI

I have a couple of servers that use NTbackup to backup to usb drives at night.

Is it possible to get an email notification setup on this backup job?

thanks
Comment
Watch Question

Commented:
Use a batch file that first backup, then email the log files
timb551IT Manager

Author

Commented:
How do i automate the emailing of the log files?
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
You can use my script as a sample of what to do - I can't provide much help on it, but your welcome to review it - you can find it at www.lwcomputing.com/mysoftware.asp
Adam GrahamEnterprise Architect

Commented:
If its SBS server you are using just configure Monitoring & Reporting in the server management console. This will allow you to receive information about various aspects of the server to a specified email.

Adam
timb551IT Manager

Author

Commented:
If its SBS server you are using just configure Monitoring & Reporting in the server management console. This will allow you to receive information about various aspects of the server to a specified email.

It does but that doesnt include the backup notifications though, at least i dont think it does.
Adam GrahamEnterprise Architect

Commented:
Hmm, I get the backup log files attached to the email?
timb551IT Manager

Author

Commented:
ok ill have a look, ta
You can set it up using the following in a batch file that is scheduled to run each night. You'll need to download BLAT to enable the email aspect and of course alter for your environmnet:

@echo off
setlocal

    Rem *************************************************************************
    Rem Get date into vairables so we can create good media name and BLAT message
    Rem *************************************************************************

for /F "usebackq delims=" %%i IN (`date /t`) DO set dt="%%isbs"
for /F "usebackq delims=" %%i IN (`date /t`) DO set sbj="Back Name %%i (Backup)"
for /F "usebackq delims=" %%i IN (`date /t`) DO set msg="Backup description %%i"

    Rem ********************************
    Rem Perform backup to media pool LTO
    Rem ********************************

rem C:\Windows\system32\ntbackup.exe backup "@C:\Backup\DailyFBU.bks" /d "Daily Backup" /v:no /m normal /j "Daily backup.job" /l:f /f "C:\DailyFBU.bks"


    Rem *******************************************
    Rem Set folder name containing backup log files
    Rem *******************************************

set fld=C:\Documents and Settings\administrator\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data

    Rem **********************************************************************
    Rem This dir command will list all log files sorted by date in bare format
    Rem **********************************************************************

set fcmd=dir "%fld%*.log" /OD /A-D /B

    Rem ***********************************************************
    Rem set command will set lastf variable to the last file in set
    Rem ***********************************************************

for /F "tokens=* delims= " %%i in ('%fcmd%') do set lastf=%fld%%%i

    Rem ******************************************************
    Rem Delete prior Blat log file and prior lastbackuplog.txt
    Rem ******************************************************

del C:\Backup\blat.log
del C:\Backup\lastbackuplog.txt

    Rem ***************************************************************
    Rem Copy Unicode log file to single-byte-per-character text file
    Rem ***************************************************************

type "%lastf%" > C\Backup\lastbackuplog.txt

    Rem *****************************************************************
    Rem Mail latest Backup log file to techsupport with embedded text version
    Rem *****************************************************************

C:\Backup\blat.exe "%lastf%" -server mail.domain.com -f notifications@domain.com -subject %sbj% -to recipient@domain.com -body %msg% -sig C:\Backup\lastbackuplog.txt -attach "%lastf%" -mime -debug -log C:\Backup\blat.log -timestamp