Export (0) Print
Expand All

Schedule Backups Using the Azure Backup Agent

Published: February 20, 2012

Updated: April 7, 2014

Applies To: Windows Server 2008 R2 with SP1, Windows Server 2012

Before you can make backups to Azure, a backup schedule for Microsoft Azure Backup is required. When this schedule configuration is complete, you can create backups as needed.

In this document

noteNote
This topic includes sample Windows PowerShell cmdlets that you can use to automate some of the procedures described. For more information, see Using Cmdlets.

Creating a backup with Microsoft Azure Backup requires that you have a valid Azure subscription and install the Azure Backup Agent and all of the prerequisite software as described in Install Azure Backup Agent and upload the certificate. You also must register the server with Microsoft Azure Backup as described in Register Servers with Azure Backup. After these tasks are completed successfully, you can schedule backups by using the Microsoft Azure Backup snap-in (obsadmin.msc) or Windows PowerShell cmdlets for Azure Backup.

WarningWarning
If you are using Azure Backup used to either backup or recover data on a server, additional backup operations cannot be started for that server. This means that when a backup operation is in progress recovery cannot be started. If you need to cancel a backup operation to perform an unexpected recovery operation, the portion of the backup completed is not deleted. Instead, an incremental backup is performed the next time the backup is run to pick up any changes and to finish the backup.

The backup schedule is the core of the backup process. It identifies which files and folders to backup and the days and times to perform the backup.

Do this step using Windows PowerShell

  1. Press the Windows logo key + Q to open the Apps menu, and then click Azure Backup Agent. The Azure Backup Agent snap-in should open.

  2. In the Action menu, click Schedule Backup to open the Schedule Backup Wizard. The Getting Started page is displayed. Click Next to continue.

  3. The Select items to backup page is displayed. The items that are specified on this page create the list of files and folders to back up.

    Click Select Items to open a dialog box that shows the tree view of the file system. You can navigate through the files and folders and select those that you want to back up.

    Click Exclusion Settings to open a dialog box in which you can select files or folders that you do not want to back up.

    noteNote
    The shorter the list of files for the backup, the more efficient the backup process will be. For example, imagine you want to back up folder D:, which is used to store all your users’ data files. Each user has an individual folder in this location. However, you do not want to include D:\temp because that folder is used for clean-up, and it does not contain any valuable data. To accomplish this, you could open the Select items dialog box, clear the check mark from D:\temp, and leave the rest of the user’s folders selected. This would create a very long backup list because each folder would be listed individually for the backup. Alternatively, you can select to back up all of D:\, and then in the Exclusion Settings dialog box, add D:\temp as an excluded item. This would create a two item backup list that would be processed much quicker.

    When you have specified the files and folders to back up, click Next to continue.

  4. The Specify backup time page is displayed. Select the day of the week and time of day that backups will occur. Retention range specifies the maximum amount of time that Microsoft Azure Backup will store backed-up data. Backups can be retained for 120 recovery points. Specify the number of days backups will be retained and whether to synchronize daily or weekly. Weekly frequency can be 1 to 4 weeks. Click Next to continue.

  5. The Confirmation page is displayed. This shows the backup schedule that you have specified by using the wizard. If you need to make any changes, click Back and make the changes, otherwise click Finish to create the schedule.

  6. The Summary page is displayed with a message that the online backup schedule was successfully created. You can now close the wizard.

After you configure a schedule, details for the backup schedule are displayed in the Microsoft Azure Backup snap-in.

PowerShell Logo Windows PowerShell equivalent commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

To start a new backup from within Windows PowerShell, administrators need to define a backup policy, the data locations, the schedule for the backup job and the data retention policy for the backup policy. The following commands will set the object variables for a basic backup job.

$policy = New-OBPolicy
$filespec = New-OBFileSpec -FileSpec <C:\Documents\Contracts>
$sched = New-OBSchedule -DaysofWeek Wednesday -TimesofDay 09:30 -
WeeklyFrequency 2
$ret = New-OBRetentionPolicy -RetentionDays 300

The following Windows PowerShell script example creates a new Microsoft Azure Backup policy named $policy that can back up all of the files and folders in the C:\Documents\Contracts folder. The backup policy runs on Wednesdays at 9:30 AM, and it will keep the data in the backup for a period of 30 days.

To add the variable to the new policy, do the following:

Add-OBFileSpec -Policy $policy -FileSpec $filespec
Set-OBSchedule -policy $policy -schedule $sched
Set-OBRetentionPolicy -policy $policy -rententionpolicy $ret

These commands put all of the previous variables into the $policy Online Backup policy object. Finally, save the Online Backup policy. Do this by using the following cmdlet:

Set-OBPolicy -policy $policy

Windows PowerShell will prompt you to ask if you want to save this backup policy. After it is saved, the new backup policy will run the next time it is scheduled.

You might want to create an initial backup to verify that the items that you want to back up are being backed up and to store an initial image with Microsoft Azure Backup. The Back Up Now Wizard enables you to run a backup schedule immediately instead of waiting for the time that is specified in the schedule. Running the Back Up Now Wizard does not prevent the backup from occurring according to the schedule, it simply provides an additional recovery point.

Do this step using Windows PowerShell

  1. On the Start screen, type obsadmin.msc.

  2. In the Action menu, click Back Up Now to open the Back Up Now Wizard. The Confirmation page is displayed. Verify that the items are those that you want to backup. Click Next to continue.

    If you need to specify a bandwidth throttling setting, proxy server settings, or a new encryption passphrase, before you perform the backup, click Change Server Properties and make the necessary modifications.

  3. Click Backup to start the backup process. The Backup Progress page is displayed, which shows how much data has been backed up.

    noteNote
    Before data is sent to the cloud backup server, it is compressed and encrypted, and metadata is added to the backup, so the amount of data that is transferred will be different than the amount of space the data consumes on your local server. Large data sets might require less space, while small data sets might consume more because of the extra information that is added to encrypt and identify the recovery point.

  4. You can close the wizard while the backup is occurring and track the progress through the Microsoft Azure Backup snap-in. The Jobs pane shows the status of Job completed when the backup is done.

PowerShell Logo Windows PowerShell equivalent commands

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

The following example can be used to perform an immediate one-time backup by using the current backup policy configured for the server.

$policy = Get-OBPolicy
Start-OBBackup -Policy $policy -Force

Continue to Recover Files and Folders Using the Azure Backup Agent.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft