Rolling NT Backup of Exchange with Email
If you need to backup exchange without having to shutdown the information store you can use the below script to backup the exchange database.
Please note that this backup will also do a rolling backup adding the week day to the backup file so you will need upto 7 times the Database size on your backup device.
NOTE: This backup sends the NT Backup.log and then deletes it. If any other NT backups are running on the server then this will create a problem with the backups logs.
Extra Files required.
You will need a copy of sendemail.exe that need to be located at %adminitpath%\programs
You will also need to create a ntbackup .bks file and save to D:\Data\AdminIT\Scripts\Exch_SysState.bks (You can remove systemstate but it is suggest this is keeped.)
“JET <Server Name>\Microsoft Information Store\First Storage Group\
SystemState”
Â
Script Below.
Rem *** this script backup exchange Database in Rolling Day files using NTbackup and send log file.
rem Created Craig Garland
Rem 29/06/09
Rem *********** Set the AdminIT folder path and call the setday batch
Set AdminITPath=d:\data\adminit
for /f %%a in (‘date /t’) do set TodayDTE=%%a
Rem ******** Set location for Logs
Set NTLogFileorg_str=%USerProfile%\local settings\Application data\microsoft\windows nt\Ntbackup\data\backup01.log
set NTlofFileFld_str=%USerProfile%\local settings\Application data\microsoft\windows nt\Ntbackup\data
set logFile_str=d:\data\adminit\logs\NTExchbak_%todayDTE%.log
set SendlogFile=d:\data\adminit\logs
Rem ************ Set the source and destination
Rem *********** Set email information
set Sender=<Senders Address>
set To=<RCPT address Best to use distribution group>
set SMTPServer=<mail server>
set Subject=”Backup Exchange with NT Backup”
set Body=”Please check the attached log file to ensure exchange files are being copied”
Rem ************ NT BAckup Commands
set NTBakDst_str=F:\Backup\Exchange\Exch_SysState_%TodayDte%.bkf
Rem run NT backup and backup file
 C:\WINDOWS\system32\ntbackup.exe backup “@%AdminITPath%\Exch_SysState.bks” /n “Exchange System State %TodayDte%” /d “Set created 29/06/09″ /v:no /r:no /rs:no /hc:off /m normal /j “Exchange System %TodayDTE%” /l:s /f “%NTBakDst_str%”
REm Move Log File
xcopy “%NTLogFileorg_str%” “%logFile_str%” /i/d/y/c
Rem Delete Log File
Del “%NTlofFileFld_str%\*.log” /y
Rem Send Logfile
%AdminITPath%\Programs\sendemail.exe -f “%Sender%” -t “%to%” -u “%Subject%” -m “%body%” -s “%SMTPServer%” -a “%logFile_str%” -l “%SendlogFile%”
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL
Leave a comment
You must be logged in to post a comment.