Solved

Can Windows Backup (ntbackup) email a backup report?

Posted on 2009-05-14
6
991 Views
Last Modified: 2012-05-11
Hi,

I need to genertate reports or logs and have them emailed to me so I can see if the backups completed or failed without actually logging into the server.

Is there anyway to do this?
0
Comment
Question by:borgmember
6 Comments
 
LVL 4

Expert Comment

by:Mitch1981
Comment Utility
I wrote this and other script, you can find it to: www.windowserver.it

Bye.
0
 

Author Comment

by:borgmember
Comment Utility
Sorry, but I do not speak whatever language that site is in :)
0
 
LVL 4

Expert Comment

by:Mitch1981
Comment Utility
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
Comment Utility
Complete the script below (variables and your ntbackup switches); it uses blat.exe (out it into the folder with the script) to send the email and will (hopefully) find and send the latest log file.
happy mailing: blat online
http://www.blat.net/

@echo off

setlocal

set From=backup@domain.com

set To=me@domain.com

set SMTP=smtp.domain.com

set Subject=Backup Report

set LogFileFolder=%UserProfile%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data
 

%Systemroot%\system32\ntbackup.exe ...
 

for /f "delims=" %%a in ('dir /o:d /b "%LogFileFolder%\*.log"') do set LogFile=%%a

"%~dp0blat.exe" "%LogFileFolder%\%LogFile%" -f %From% -to %To% -server %SMTP% -subject "%Subject%"

Open in new window

0
 

Author Closing Comment

by:borgmember
Comment Utility
I used this post to get it working. I also used information from this site: http://www.fishbrains.com/posts/154

I had to modify the script to fit my needs, but the middle part starting with %systemroot% now looks like this:

%Systemroot%\system32\ntbackup.exe backup "@c:\scripts\ntbackup\nightly.bks" /d "Nightly Backup" /v:yes /r:no /rs:no /hc:off /m normal /j "nightly" /l:s /f e:\nightly.bkf

Here is the contents of the nightly.bks file:

C:\
D:\
SystemState
0
 
LVL 14

Expert Comment

by:quizwedge
Comment Utility
Instead of "%~dp0blat.exe", I used the actual path as "%~dp0blat.exe" didn't work for me, but what a great script!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now