Carl's blog

Scheduled Backup to RDX / RD1000 with SBS 2008 and wbadmin

by on Dec.11, 2010, under Computer Stuff

Note: Since this article was published, I have altered my RDX strategy, and I no longer backup to a shared folder like this.
Please see the newer article here: http://www.css-networks.com/2011/12/sbs-2008-2011-automatic-backup-to-rdx-rd1000-without-cifssmbshared-folders/

(Of course you can mix bits of the more thorough script below, with the wbadmin command from the newer article above.)

Using wbadmin, you can back up everything, including Exchange, to the RD1000.
If you tell wbadmin to back up to the target drive directly, e.g E:, it will want to reformat the disk every time and therefore only allow one backup on the disk, and it will prompt you to allow the format, even if you gave the parameter -quiet. So instead we share the RD1000 and use a script like this:

@echo off
set Logfile="c:\network shares\company\Backup Log.txt"
rem Should be called with backup name as parameter, backup will be stored in that backup name's folder.
echo. >>%logfile%
Echo ***** Backup starting at %date% on %time% >>%logfile%
Echo Creating Backup Directory at \\server\rd1000\%* >>%logfile%
if not exist "\\server\rd1000\%*" md "\\server\rd1000\%*" >>%logfile%
Echo. >>%logfile%
Echo ***** Starting Data and System files backup >>%logfile%
wbadmin start backup -backuptarget:"\\server\rd1000\%*" -include:c: -quiet >>%logfile%
Echo. >>%logfile%
Echo ***** Starting Exchange Server Backup >>%logfile%
del "C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\*.log"
ntbackup backup "@C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\Exchange.bks" /a /d "Exchange Server" /v:no /r:no /rs:no /hc:off /m normal /j "Exchange Server" /l:s /f "\\server\rd1000\%*\Exchange Server.bkf"
type "C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\*.log" >>%logfile%
echo. >>%logfile%
echo ***** Starting IRIS backup >>%logfile%
sqlcmd -S SERVER\IRISPRACTICE -Q "BACKUP DATABASE [IRIS] TO DISK = N'\\server\rd1000\%*\IRIS-FUll Backup.bak' WITH NOFORMAT, INIT, NAME = N'IRIS-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10" >>%logfile%

Save the script as c:\dobackup.cmd , and call as “c:\dobackup Daily Backup” or “C:\dobackup Monday” with the Task Scheduler. Obviously make sure there is enough space on your RD1000 for five backups. If not, alter the script or just call it with “Set1″ and “Set2″ instead of Monday, Tuesday, Wednesday etc.

Although it looks like there is nothing there to say “Back up the Exchange IS”, there is an “Application” entry for Exchange in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WindowsServerBackup\Application Support\{76fe1ac4-15f7-4bcd-987e-8e1acb462fb7} , and the output of the backup says “Running consistency check for application Exchange.” This confirms Microsoft’s documentation that SBS’ version of Windows Server Backup does indeed back up Exchange.

Because I am a wuss, and I have no faith, I am also doing an NTBackup of the Exchange IS to a file on the disk. The NTBackup files that you will need to run NTBackup on SBS 2008 can be found here. Extract them to C:\Windows, because there is a VSSAPI.DLL in Windows\System32 that NTBackup doesn’t like. If you extract the files to \Windows, ntbackup will use the VSSAPI.DLL in its own directory.


2 Comments for this entry

  • MDL1983

    Great article, however my SBS doesn’t have a “C:\Users\Administrator\AppData\Local\Microsoft\Windows NT\NTBackup\data\” directory, what is the purpose of this part of the batch file, clearing of the log files so Exchange recognises it’s being backed up?

  • Carl

    No. What we are doing with that part of the batch file, is simply inserting the contents of NTBackup’s log file into our own log file.

    NTBackup creates rotating log files under the %Appdata%\Microsoft\Windows NT\NTBackup\data directory. They are labelled “backup01.txt”, “backup02.txt” etc. You will notice that earlier on in the batch file, we deleted all existing *.log files from that directory, and then we ran the backup, and then we “type *.log >> ourlogfile” after the backup, since we never really know exactly which of the backup0xx.log files is the one we want – so we clear them all out at the beginning every time.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...