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.
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.
To 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.
Use 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.
After 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).
You 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:
If you want to schedule a batch file to perform additional tasks along with
the backup, you can copy the backup command string from a scheduled backup job
by viewing any of the scheduled tasks properties from the Schedule
Jobs tab in Ntbackup or by using the Scheduled Tasks tool in Control
Panel. You can then put the command string in a separate batch file, modify
the string to fit your needs, and schedule the batch file to run by using the
at command or Task Scheduler.
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
PHYSICAL_MEDIA
Monday-Full - 1
Tuesday-Full - 1
Wednesday-Full - 1
Thursday-Full - 1
Friday-Full - 1
The command completed successfully.
After the backup is finished, in each day's batch file, use the rsm eject command to eject that day's tape:
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
To 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
/g
/f
/t
When you use the /um option, Ntbackup searches the following media pools for available media:
When Ntbackup detects an available tape, the search stops, and the tape is
formatted and used without prompting you for input. This command is not
applicable to tape loaders; use this command only if you have a stand-alone
tape device.
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.
Note 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:
-or-
To prevent these errors, refer to the following article in the Microsoft Knowledge Base for a solution or a workaround:
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 reuse the same tape for a scheduled incremental backup by
appending the backup to the same tape, use the Managed method that is
described in this article, instead of using the /um option.
The 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
Example 2
This is a more complex example, however, it is a real-life example that
performs the following procedures completely unattended:
Machine_Name-date-time
Here is the example.
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
For a list of all available backup options or for detailed information about options that are used in these examples, refer to the Ntbackup Help file. Type the following command at a command line:
ntbackup /?
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
234492 Backup Creates New Tape GUID When Writing New Label
267574 Scheduled Backups Fail on Standalone Tape Drives After Changing Media
243260 Changed Command Parameters for Scheduled Backup Job May Not Be Saved
204833 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 Hewlett-Packard SureStore Tape Drive May Not Work on Computers with Large Amounts of Memory
242881 Advanced Settings Are Not Honored with Scheduled Backups
264604 Scheduled Backup Jobs May Not Run As Expected
295159 Scheduled Backups May Hang After Mounting Tape.