Customizing Windows Server Backup Schedule
Windows Server Backup (WSB) is the built-in backup solution for Windows Server 2008 that replaces the venerable NT Backup from Windows Server 2003 and before. WSB protects the files and the server os/application binaries within itself as a single-server solution. To consolidate protection across multiple servers or applications like SQL Server, Exchange, SharePoint or Hyper-V, then Microsoft would recommend looking at System Center Data Protection Manager ( DPM ).
By design, WSB ensures that you have recent backups by performing its local backup operations at least once per day. While this is good and recommended there may be reasons specific to your environment where you may want to take backups at a lesser frequency or have multiple backup schedules (e.g. daily and weekly). For example, you may want to backup your files every day, while backing up the system state at lesser frequency say once a week.
You can extend the functionality of Windows Server Backup to meet all these advanced needs through simple scripts that uses Windows Server Backup Command Line Tool ( WBADMIN ) and the Windows Task Scheduler ( SCHTASKS ).
If you are not aware of Task Scheduler, it is a a management application provided in Windows operating systems that allows you to schedule any task for a given set of conditions. Task Scheduler also provides a command line interface (CLI) through the command SCHTASKS .
Samples
The samples here assume the following configuration of the system:
· A single disk containing system drive (C:),
· Two data volumes (D: and E:)
· Dedicated backup volumes (H:, I: and J:).
These volume names and parameters are used as boldface in the samples below. Readers can customize them as per their requirements.
Sample 1: Daily Data Volume Backup
The following command will create a Task Scheduler task named DailyVolumeBackup with the start time of 23:00. This task will run DAILY with the HIGHEST privileges. It will run the Windows Server Backup CLI to backup volume E: to target volume H:.
Syntax:
SCHTASKS /Create /SC DAILY /TN <TaskName> /RL HIGHEST /ST <StartTime> /TR <Windows Server Backup Command>
Example:
SCHTASKS /Create /SC DAILY /TN DailyVolumeBackup /RL HIGHEST /ST 23:00 /TR "WBADMIN START BACKUP -backupTarget: H: -include: e: -quiet >> C:backupLogs.txt"
Sample 2 : Weekly Backup of System State
The following command will create a Task Scheduler task named WeeklySystemStateBackup that runs every Saturday ( SAT ) at 19:00. This task will run WEEKLY with the HIGHEST privileges. It will run the Windows Server Backup CLI to backup SYSTEMSTATEBACKUP to target volume I:.
Syntax:
SCHTASKS /Create /SC WEEKLY /D <Day Of Week> /TN <TaskName> /RL HIGHEST /ST <StartTime> /TR <Windows Server Backup Command>
Example:
SCHTASKS /Create /SC WEEKLY /D SAT /TN WeeklySystemStateBackup /RL HIGHEST /ST 19:00 /TR "WBADMIN START SYSTEMSTATEBACKUP -backupTarget: I: -quiet >> C:backupLogs.txt "
Sample 3 : Complete System Backup Once in Two Weeks
The following command will create a Task Scheduler task named OnceInTwoWeeksFullBackup that runs every Sunday ( SUN ) at 1:00 once every 2 weeks . This task will run WEEKLY with the HIGHEST privileges. It will run the Windows Server Backup CLI to backup allCritical volumes to target volume J:.
Syntax:
SCHTASKS /Create /SC WEEKLY /MO <WeekFrequency Modifier> /D <Day Of Week> /TN <TaskName> /RL HIGHEST /ST <StartTime> /TR <Windows Server Backup Command>
Example:
SCHTASKS /Create /SC WEEKLY /MO 2 /D SUN /TN OnceInTwoWeeksFullBackup /RL HIGHEST /ST 01:00 /TR "WBADMIN START BACKUP -backupTarget: J: -allCritical -quiet >> C:backupLogs.txt "
Notes:
Post by Chirag Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.