Article ID: 314844 - Last Review: February 19, 2007 - Revision: 2.5 How to schedule unattended backups by using a stand-alone tape libraryThis article was previously published under Q314844 On This PageSUMMARY This article describes how the Windows backup tool
(Ntbackup.exe) is designed to work with Removable Storage Manager (RSM) to
manage media during a backup session. This method is especially effective if
you have a tape library that holds several tapes, because RSM can automatically
mount and dismount tapes when the scheduled backup program calls for a tape.
This makes unattended backups possible because RSM loads the correct tape and
either overwrites or appends to the tape, depending on the backup options that
you select. MORE INFORMATION If you have a stand-alone tape library (that is, one that
requires you to manually load or unload media), you can schedule nightly
unattended backups provided the data that you are backing up can fit on a
single tape. If the data cannot fit on a single tape, the NTBackup tool pauses
and asks for new (prepared) media, regardless of which of the following methods
you use. There are two methods that you can use to perform unattended backups.
Managed MethodTo use this method, label the tapes (one for each day of the week), and then schedule a recurring weekly backup (one for each day). The only manual intervention that is required is to make sure that the previous night's backup tape is ejected and the next night's tape is inserted into the stand-alone tape library. A non-technical assistant can perform this manual operation any time before the next scheduled backup session.The following section outlines the basic concept and the steps necessary to prepare and label the tapes and tells how to schedule Ntbackup to use the tapes. The example that is used is an abbreviated example that shows how to perform normal backups every night (Monday through Friday), overwriting the tape each time. Depending on your needs, you can perform incremental backups during the week and then perform full backups on the weekend by using different sets of tapes. Before Ntbackup can use a tape, the tape must be located in the RSM import, free, or backup media pool.
Preparing the TapesUse the following steps to prepare each tape that you want Ntbackup to use. This operation writes a "free media" label on each tape. Remember that Ntbackup can use only prepared tapes during a backup session. Calculate how many tapes you need for your backup strategy, and prepare each tape before you continue to the next section.
Labeling the TapesAfter you prepare the tapes, use Ntbackup to write a Microsoft Tape Format (MTF) label. Use a name that describes the contents of the tape. After this is accomplished, you can schedule Ntbackup to use that tape over and over again, by specifying the same media label name.Use the following steps to label each tape that you want Ntbackup to be able to reuse. NOTE: This operation writes a unique MTF label on each tape. Make sure that each tape has a unique name, even if you rotate different sets of tapes (weekly).
Scheduling Recurring Weekly BackupsYou can schedule recurring weekly backup jobs by using the built-in scheduler in Ntbackup. You can choose to build a batch file to use with the Scheduled Tasks Wizard or the at schedule command.First, use Ntbackup to create a backup selection (.bks) file that Ntbackup uses to detect which drives/folders/files to back up. You also need to use Ntbackup to build the backup command line string to be used in the batch files if scheduling outside of the backup scheduler. To schedule recurring weekly backups:
The following example shows a backup command line that was copied from the properties of a scheduled backup: c:\winnt\system32\ntbackup.exe backup "@c:\documents and settings\bkupuser\local settings\application data\microsoft\windows nt\ntbackup\data\daily.bks" /n "monday-full" /d "mondays full backup" /v:no/r:no /rs:no /hc:on /m normal /j "mondays job" /l:f /t "monday-full" The last parameter can be /g guid to represent the RSM Logical_Media ID instead of /t for "tape_name." The {guid} value is a 32-byte value in the form of
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx." You can use either parameter to
represent and use the tape in a batch file. Besides looking at the properties
of a scheduled backup job, the {guid} values for all logical media can be extracted by
using the following Rsm.exe command. They are not listed in order, so it is
difficult to tell which {guid} value represents which tape. rsm.exe view /tphysical_media /guiddisplay You can also use the Rsm.exe command-line tool in the batch file
to instruct RSM to eject the tape when the backup is finished. Use Rsm.exe and
issue the following command to extract the physical media names ahead of time
to use with the eject command: rsm view /tphysical_media After the backup is finished, in each day's batch
file, use the rsm eject command to eject that day's tape: PHYSICAL_MEDIA Monday-Full - 1 Tuesday-Full - 1 Wednesday-Full - 1 Thursday-Full - 1 Friday-Full - 1 The command completed successfully. rsm eject /pf"monday-full - 1" /astart The following example shows a sample backup batch file that is to
run on Mondays: echo off start /wait c:\winnt\system32\ntbackup.exe backup "@c:\documents and settings\bkupuser\local settings\application data\microsoft\windows nt\tbackup\data\daily.bks" /n "monday-full" /d "mondays full backup" /v:no/r:no /rs:no /hc:on /m normal /j "mondays job" /l:f /t "monday-full" rsm eject /pf"monday-full - 1" /astart Unmanaged MethodTo use the unmanaged method, just use the /um option at the end of the backup command string. This tells Ntbackup to find the first available tape, format the tape, and then use that tape for the current backup operation. When you use the /um option, you must use the /p option to designate a media pool device (for example, "8mm mp"). If you do this, you must not use the following options:/a When you use the /um option, Ntbackup searches the following media pools for available
media:
/g /f /t
NOTE: The /um option works on only the initial tape request. The /um option was not intended to be used when spanning tapes, because spanning tapes requires human intervention. Ntbackup does not overwrite any tape other than the original (first) tape of a backup set; you must use RSM to manally prepare any additional tapes before Ntbackup will use a tape to complete the scheduled backup. Related IssuesNote that some low-cost, stand-alone tape drives do not notify RSM that media has been changed. If you are using this type of tape drive, one of the following error messages is recorded in the backup report during the next backup cycle: The operation was not performed
because no unused media was available.
-or-
Operation was not performed, because the
specified media cannot be found. Additionally, if you are trying to schedule a recurring backup to a single tape device by using the /p option, you may see either of the errors listed above in the backup report. Or, if you are using a Windows Server 2003-based computer, you may receive the following error message: Cannot locate the specified
media or backup device. This backup operation will terminate. To prevent these errors, refer to the following article in the Microsoft Knowledge Base for a solution or a workaround: 267574
(http://support.microsoft.com/kb/267574/
)
Scheduled Backups Fail on
Standalone Tape Drives After Changing Media
If you use the /um option, it is recommended that you not use the /n option to label the media. Instead, permit Ntbackup to use the
default date/time as the label name and description. This eliminates the
problem of multiple tapes' having the same label name, which can cause RSM to
ask for a manual tape mount and prevent Ntbackup from continuing to completion
unattended. If
you want to re-use the same tape for a scheduled incremental backup by
appending to the same tape, you should use the "managed method" described above
instead of using the /um option.Examples of Backup Batch FilesThe following are examples of backup batch files. The second example requires the Sleep.exe utility from the Windows 2000 or Windows XP Resource Kit to ensure reliability.Example 1
echo off
start /wait rsm.exe refresh /lf"your_library_name"
c:\winnt\system32\ntbackup.exe backup "@c:\documents and
settings\bkupuser\local settings\application data\microsoft\windows
nt\ntbackup\data\daily.bks" /v:no /r:no /rs:no /hc:on /m normal
/j "daily.job" /l:f /p "8mm mp" /um
This is a more complex example, however, it is a real-life example that performs the following procedures completely unattended:
echo off
rsm.exe refresh /LF"HP C1537A SCSI Sequential Device"
sleep 30
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
c:\winnt\system32\ntbackup.exe backup "@C:\Documents and Settings\Administrator\Local Settings
\Application Data\Microsoft\Windows NT\NTBackup\data\Daily.bks"
/n "%computername%-%dtt%" /d "daily %dtt%" /v:yes /r:no /rs:no /hc:on
/m normal /j "daily %dtt%" /l:f /p "4mm DDS" /UM
rsm.exe eject /PF"%computername%-%dtt% - 1" /astart
exit
ntbackup /? For
additional information, click the article numbers below to view the articles in
the Microsoft Knowledge Base: 234492
(http://support.microsoft.com/kb/234492/EN-US/
)
Backup Creates New Tape GUID When Writing New Label
267574
(http://support.microsoft.com/kb/267574/EN-US/
)
Scheduled Backups Fail on Standalone Tape Drives After Changing Media
243260
(http://support.microsoft.com/kb/243260/EN-US/
)
Changed Command Parameters for Scheduled Backup Job May Not Be Saved
204833
(http://support.microsoft.com/kb/204833/EN-US/
)
Backup Can Select Only the First of Two Identical Tape Drives
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base: 269600
(http://support.microsoft.com/kb/269600/EN-US/
)
Hewlett-Packard SureStore Tape Drive May Not Work on Computers with Large Amounts of Memory
242881
(http://support.microsoft.com/kb/242881/EN-US/
)
Advanced Settings Are Not Honored with Scheduled Backups
264604
(http://support.microsoft.com/kb/264604/EN-US/
)
Scheduled Backup Jobs May Not Run As Expected
295159
(http://support.microsoft.com/kb/295159/EN-US/
)
Scheduled Backups May Hang After Mounting Tape.
| Article Translations
|
Back to the top
