Export (0) Print
Expand All

Schedule Backups Using the Azure Backup Agent

Published: February 20, 2012

Updated: February 11, 2015

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

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 vault credential. You also must register the server or computer with Microsoft Azure Backup as described in Register a server 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.

If you are using Azure Backup to either backup or recover data, additional backup operations cannot be started for that computer. 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 completed portion of the backup 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. Open Azure Backup Agent , or if you do not know where the agent is installed, press the Windows logo key + Q to open Search, and then type Azure Backup. The Azure Backup Agent agent should show in the list of results. Click to open the agent.

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

    The Select items to backup page is displayed.

  3. Use Add Items and/or Exclusion Settings buttons to create the list of items you want to backup.

    Click Add 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.

    The shorter the list of files, the more efficient the backup process will be. If you want to back up the majority of content on a drive or files in a folder it may be easier, and more efficient to back up everything except for the files or folders that you do not want. Use the Exclusion Settings to specify files or folders you want to exclude from the backup process. For example, imagine you want to back up drive 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 does not contain valuable data. To exclude D:\temp from the backup, 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 use Select Items button to select to back up all of D:\, and then in Exclusion Settings, add D:\temp as an excluded item. This would create a two item backup list that would be processed much quicker. Use the Remove Items button to delete the selected item from the list.

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

  4. In the Specify Backup Schedule, select the time(s) of the day and the day(s) of the week when the backups will occur.

    You can create up to three backups within a 24-hour period. By default, the schedule is set to back up each Day, and you can specify those times when you want the backup process to begin. If you want to change the backup schedule to an interval period longer than a day, select Week. This selection will open additional interval settings. You can then specify an interval of one, two, three, or four weeks, and choose which days of those weekly intervals to create backups.

    Once you have defined the schedule for backups, click Next to continue and define the retention policy.

  5. Use the Select Retention Policy to validate the times and days when backups are created, and to apply a length of time for retaining those backup copies.

    The Retention Policy schedule allows you to create policies based on daily, weekly, monthly and yearly intervals. The initial times and days for each policy are based on what was defined in the Backup Schedule. The default retention periods specified in the UI are Daily - 180 days; Weekly - 104 weeks; Monthly - 60 months; and Yearly - 10 years, but these are merely suggestions. You can set any retention policy to have a maximum value up to 100 years. To edit the timing intervals – for example, you create backup copies on Monday, Wednesday and Friday, but only want to retain the Friday backup - click Modify and make your edits. You can have a maximum of 366 recovery points planned. Once you have set the retention policies, click Next to establish how you want to create your initial backup.

  6. When choosing your Initial Backup Type, select Automatically over the network to use your existing network, or choose Offline Backup to use the Azure Import service to ship hard drives with large quantities of data to an Azure data center for faster upload than what you would get over the network.

    For information on how to use the Offline Backup option to save your initial backup, please see Offline Backup Overview.

    After choosing how to make your initial backup, click Next to view the Confirmation page.

  7. 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 Previous and make the changes, otherwise click Finish to create the schedule.

  8. 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 12:00 -
WeeklyFrequency 2
$ret = New-OBRetentionPolicy -RetentionDays 20 -RetentionWeeklyPolicy -WeekTimesOfDay 12:00:00  -WeekDaysOfWeek Sunday,Monday -RetentionWeeks 20 -RetentionMonthlyPolicy -MonthDaysOfMonth 30 -MonthTimesOfDay 12:00:00 -RetentionMonths 11 -RetentionYearlyPolicy -YearMonthsOfYear January,March -YearWeeksOfMonth Second -YearDaysOfWeek Sunday -YearTimesOfDay 12:00:00 -RetentionYears 11 

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 12:00, and it will keep the data in the backup based on multiple retention ranges for a variety of backup times. The longest period is for 11 years.

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 Back Up 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 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.

    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
© 2015 Microsoft