How to schedule unattended backups using a stand-alone tape library

Article translations Article translations
Article ID: 239892 - View products that this article applies to.
This article was previously published under Q239892
Notice
This article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy.
Expand all | Collapse all

On This Page

SUMMARY

This Windows Backup (Ntbackup.exe) tool is designed to work with Removable Storage Manager (RSM) to manage media during a backup session. This is especially effective when you have a tape library that holds several tapes, because RSM can automatically mount and dismount tapes as required 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, based on the backup options you choose.

MORE INFORMATION

When you have a stand-alone tape library (one that requires you to manually load/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 - backup will pause and ask for new (prepared) media regardless of which method described below is used. There are two methods you can use to perform unattended backups:
  • Managed method: You can use this method when you want to manage your media. This method ensures the proper tape is always in the tape drive before overwriting the tape. This is the recommended method.
  • Unmanaged method: This method simply overwrites the tape that is currently in the stand-alone tape drive with the current backup job. This method is easier to implement, but it may overwrite critical data if the proper tape is not in the tape drive before you start the scheduled backup. This method is not recommended if you are sharing the stand-alone tape drive with different programs.

Managed Method

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 ensure 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 anytime before the next scheduled backup session.

The following section outlines the basic concept and steps necessary to prepare and label the tapes, and how to schedule Ntbackup to use the tapes. This is an abbreviated example that describes performing normal backups every night (Monday-Friday), overwriting the tape each time. Based on your needs, you may want to perform incremental backups during the week and perform full backups on the weekend 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.

Import media is media that RSM recognizes as being compatible with an installed program like Ntbackup, but has not been cataloged and moved to that program's media pool yet. If Ntbackup detects media in the import media pool that it recognizes, you receive a message asking if you want to import the media. After the media is imported, you can use it to perform a restore or for a new backup.

Free media is media that RSM prepares for any program to use by writing a free media label. Programs pull tapes from the free media pool the first time you use a tape, and then allocate the tape to that program's media pool for use with future jobs.

Preparing the Tape

Use the following steps to prepare each tape that you want Ntbackup to use.

Note This operation writes a free media label on each tape.
  1. Using Computer Management, expand Storage, expand Removable Media, and then expand Physical Locations.
  2. Locate and expand the entry for the tape device, and then click the Media icon under the tape device.
  3. Insert a tape into the tape drive. RSM reads the tape, and the media pool in which it resides is displayed in the right pane (for fresh media, this is typically the unrecognized media pool).
  4. In the right pane, right-click the tape, and then click Prepare. You can monitor the work queue for the operation to make sure it is finished, or you can wait for the status to change to "Idle, available" and the media pool to change to "free."
  5. After a free label is written, you can eject the tape by right-clicking the tape, and then clicking Eject. The Eject Wizard starts and moves the tape to the off-line media library.
  6. Repeat steps 3-5 for each tape you want to prepare. Remember that Ntbackup can only use 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 Tape

After you prepare the tapes, use Ntbackup to write a Microsoft Tape Format (MTF) label with 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 you want Ntbackup to be able to reuse.

Note This operation writes a unique MTF label on each tape. Be sure each tape has a unique name, even if you rotate different sets of tapes (weekly).
  1. Make sure a prepared tape is in the stand-alone tape library.
  2. Start Ntbackup, and then click Backup Wizard.
  3. When the What to Backup dialog box is displayed, click backup selected files, drives, or network data.
  4. When the Items to Backup dialog box is displayed, click a single folder on any local drive.
  5. When the Where to Store the Backup dialog box is displayed, in the backup media type area, click the tape drive, and in the backup media area, click new media.
  6. When the Completing the Backup Wizard dialog box is displayed, click Advanced.
  7. Continue through the screens until the Backup Label dialog box is displayed. In this dialog box, you can change the Backup Label and Media Label fields. The information in the Media Label field distinguishes one tape from another. You should change the Media Label field so that it contains meaningful information to represent a tape for each day of the week. The example in this article uses unique names like Monday-Full, Tuesday-Full, and so on (one for each day/tape).
  8. Continue through the dialog boxes and start the backup. This backs up the single folder and writes a meaningful media label that you can use from now on to schedule backups.
  9. After the backup process is finished, quit Ntbackup.
  10. Using RSM, look in the backup media pool and notice the tape is present. Right-click the tape to view its properties. If you click the side tab, the identification label field contains the same name of the tape you specified in step 7. That is the name you want to use from now on whenever you schedule a backup for that day's tape and choose to rewrite the same label name.
  11. Right-click the tape, click Eject, and then physically label the tape using the same label name you specified during backup.
  12. Repeat the steps above for each tape until all tapes have valid MTF media labels.

Scheduling a Recurring Weekly Backup

You can schedule recurring weekly backup jobs 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, you need to 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 file(s) if scheduling outside of the backup scheduler.

To schedule recurring weekly backups:
  1. Start Ntbackup, and then click Backup Wizard.
  2. Follow the wizard screens and choose the appropriate volumes or folders you want to back up every night.
  3. When the Where to Store the Backup dialog box is displayed, in the backup media type area, click the tape drive, in the backup media area, click the name of the tape that matches the day for which you are currently scheduling the backup (for example, Monday-Full).
  4. When the Completing the Backup Wizard dialog box is displayed, click Advanced.
  5. When the Media Options dialog box is displayed, click Replace the data on this media with the backup.
  6. When the Backup Label dialog box is displayed, change the Media Label field to match the media label of the current tape. This ensures that the same tape can be mounted during the next recurring backup for this day's tape.
  7. When the When to Backup dialog box is displayed, click Later, and then type a descriptive job name.
  8. Click Set Schedule, and schedule the backup to run at the appropriate time. To make this day's backup recurring, click Weekly in the Schedule Task list.
  9. Repeat the above steps for each day of the week, scheduling the backup to reoccur weekly. Make sure you use the correct media label in step 5 to match that day's tape name.
  10. Make sure the labeled tape for the current backup is in the stand-alone tape library.
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 it in a separate batch file, modify the string to fit your needs, and schedule it using the at command or Task Scheduler.

The following example is a backup command line that was copied from the properties of a scheduled backup that was performed above:
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"
Note The last parameter may be /g {guid} to represent RSM Logical_Media ID instead of /t "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 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 /tlogical_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 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\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"
rsm eject /pf"Monday-Full - 1" /astart

Unmanaged Method

To use the unmanaged method, simply use the /um switch 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. You must use the /p switch to designate a media pool device (for example, "8mm mp") when you use the /um switch. If you do this, you must not use the following switches:
/a
/g
/f
/t
When you use the /um switch, Ntbackup searches the following media pools for available media:
  • Free pool
  • Import pool
  • Unrecognized pool
  • Backup pool
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 and should only be used if you have a stand-alone tape device.

NOTE: The /um switch will only work on the initial tape request. The /um switch was not intended to be used when spanning tapes since this requires human intervention. Ntbackup does not overwrite any tape other than the original (first) tape of a backup set; any additional tapes must be manually prepared using RSM before ntbackup will use it to complete the scheduled backup.

Note If you are trying to schedule a repeating backup to a single tape device using the /p switch, you may see one of the following errors in the backup report:
  • The operation was not performed because no unused media was available.
    -or-
  • Operation was not performed, because the specified media cannot be found.
To prevent these errors, use the /um unmanaged method switch.

Note When you use the /um switch, we recommend that you do not use the /n switch to label the media. Instead, permit backup to use the default date/time as the label name and description. This eliminates multiple tapes having the same label name that may cause RSM to ask for a manual tape mount and prevent backup from continuing/completing 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 switch.

Note 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, please reference the following articles for a solution or workaround:
267574 Scheduled backups fail on standalone tape drives after changing media
330306 Removable storage may not refresh the tape

The following are examples of backup batch files. Both examples require the Sleep.exe utility from the Resource Kit to ensure reliability.

Note Some lines have been wrapped for readability.
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:
  • Refreshes RSM database.
  • Sleeps for 30 seconds to ensure that RSM is refreshed.
  • Sets environment variables used to create unique tape names.
  • Starts Ntbackup, which Mounts any existing tape in the tape drive by using the /um switch.
  • Performs the backup and changes the tape name to the following format:
    Machine_Name-date-time
  • Ejects the tape from the tape drive.
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 switches or for details on switches used in these examples, you can reference the Ntbackup Help file from a command line by typing the following command:
ntbackup /?
For additional information, click the following article numbers 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

Properties

Article ID: 239892 - Last Review: October 26, 2007 - Revision: 4.5
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Datacenter Server
Keywords: 
kbproductlink kbfaq kbhowto KB239892

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com