Friday, August 26, 2011

Scheduling multiple backups with Task Scheduler and Windows Server Backup for Exchange Server 2010

I’ve been working on a project for a school that had limited budget this year for their infrastructure and was not able to upgrade their Microsoft DPM 2007 backup software to the latest version and since DPM 2007 does not support backing up the Exchange Server 2010 information stores, the only alternative solution for them was to use the build in Windows Server Backup application that is natively built into Windows Server 2008 R2.  The challenge of using Windows Server Backup was that you could only schedule one backup job from within the GUI and because I had to stagger the backup jobs to have them save the backups to different folders, what I needed to do was manually create backup jobs within Task Scheduler.

The first task was to figure out what the proper syntax was and since backup jobs in Windows Server Backup was essentially a task scheduled with the %windir%\System32\wbadmin.exe command, I simply looked up the switches available for the wbadmin.exe command.  Details and explanation for this command can be found here: http://technet.microsoft.com/en-us/library/cc754015(WS.10).aspx and all the switches to start a backup job can be found here: http://technet.microsoft.com/en-us/library/cc742083(WS.10).aspx.

As shown in the Parameters in the link above, the switches we’re interested are as follows:

Parameter Description

-backupTarget

Specifies the storage location for this backup. Requires a hard disk drive letter (f:), a volume GUID-based path in the format of \\?\Volume{GUID}, or a Universal Naming Convention (UNC) path to a remote shared folder (\\<servername>\<sharename>\). By default, the backup will be saved at: \\<servername>\<sharename>\WindowsImageBackup\<ComputerBackedUp>\.

-include

For Windows°Vista and Windows Server 2008, specifies the comma-delimited list of volume drive letters, volume mount points, or GUID-based volume names to include in the backup. This parameter should be used only when the -backupTarget parameter is used.

For Windows°7 and Windows Server 2008 R2, specifies the comma-delimited list of items to include in the backup. You can include multiple files, folders, or volumes. Volume paths can be specified using volume drive letters, volume mount points, or GUID-based volume names. If you use a GUID-based volume name, it should be terminated with a backslash (\). You can use the wildcard character (*) in the file name when specifying a path to a file. Should be used only when the -backupTarget parameter is used.

-vssFull

Performs a full back up using the Volume Shadow Copy Service (VSS). All files are backed up, each file's history is updated to reflect that it was backed up, and the logs of previous backups may be truncated. If this parameter is not used wbadmin start backup makes a copy backup, but the history of files being backed up is not updated.

-quiet

Runs the subcommand with no prompts to the user.

The schedule I worked out was to backup the information store in different folders on \\backupServer\f$ for different days as shown in the following:

Monday Tuesday Wednesday Thursday Friday Saturday
Backup_Mon_Thurs Backup_Tues_Fri Backup_Wed_Sat Backup_Mon_Thurs Backup_Tues_Fri Backup_Wed_Sat

Note that this is just an example and the folders are set up as such because of the limited drive space I had.

Once you’ve determined the amount of scheduled backups you need, you can proceed with setting up x amount of scheduled tasks in the Task Scheduler with the action setup as such:

start backup -backuptarget:\\backupServer\f$\Backup_Mon_Thurs -include:e:,f: -vssFull -quiet

start backup -backuptarget:\\backupServer\f$\Backup_Tues_Fri -include:e:,f: -vssFull -quiet

start backup -backuptarget:\\backupServer\f$\Backup_Wed_Sat -include:e:,f: -vssFull –quiet

image

image

image

image

In my example, the e: and f: drives are my database and log drives and therefore was included into the parameters.  The -vssFull switch is important for Exchange 2010 backups so that the job can flush the logs so make sure you include it into the parameters.

Hope this helps anyone who needs a temporary backup solution for Exchange Server 2010 and/or in some cases, need to flush the logs for an Exchange 2010 server because the log drive has filled up and turning on circular logging is not an option.

1 comment:

Anonymous said...

How do you restore an older backup using this method?

When you click on Windows Backup and choose Recover, it only allows you to choose the last backup date and you can't restore from any of the other backup dates.