Chapter 14 examined the recommended backup and restoration methods for Windows 2000 and Windows Server 2003. However, in mixed environments a command-line approach may also be warranted; in this approach, a user can back up data to tape, floppy, and hard disk. Windows NT commands such as backup and restore are no longer fully supported. The Ntrestore utility can be used either to launch the graphical backup tools or in a command-line mode.
The Ntbackup utility can be used from the command prompt or within a batch file to achieve the same results as with the graphical backup. It has several formats, but the primary syntax is
ntbackup backup path [options]
The backup parameter must be included except for the other variations of the syntax shown in Table A.24. The path parameter should contain the path or paths of the directories to be copied to the backup tape. Table A.24 identifies the options available for the command. They can be entered in any sequence.
To erase a tape, enter the following command:
ntbackup /nopoll
No other options are available with the /nopoll switch. This format requires user input and cannot be used in a batch file.
Option |
Qualifier |
Description |
---|---|---|
/b |
Backs up the Registry from the local system. |
|
/e |
Includes exceptions only in the backup log. The default is to create a full and detailed backup log. |
|
/hc:on |
Turns on hardware compression. Not valid if the /a option is used. |
|
/hc:off |
Turns off hardware compression. Not valid if the /a option is used. |
|
/l |
"filename" |
Creates a log file as file name. The path can be included as part of file name. |
/r |
Restricts access to the data on the backup tape to members of the Administrators group and the Backup Operators group. Must not be used with the /a option. |
|
/t |
type |
Specifies the backup type, where type can be one of the following values: copy, daily, differential, incremental, normal. |
/tape:n |
Identifies the number of the tape drive to use, where n can be a value from 0 through 9. This option is necessary only if there is more than one tape drive on the system. |
|
systemstate |
Specifies that you want to back up the System State data. When you select this option, the backup type will be forced to normal or copy. |
|
@bks file name |
Specifies the name of the backup selection file (.bks file) to be used for this backup operation. The at (@) character must precede the name of the backup selection file. A backup selection file contains information on the files and folders you have selected for backup. You have to create the file using the GUI version of Backup. |
|
/J {"job name"} |
Specifies the job name to be used in the log file. The job name usually describes the files and folders you are backing up in the current backup job as well as the date and time you backed up the files. |
|
/P {"pool name"} |
Specifies the media pool from which you want to use media. This is usually a subpool. You cannot use the /A, /G, /F, or /T command-line options. |
|
/G {"guid name"} |
Overwrites or appends to this tape. Do not use this switch in conjunction with /P. |
|
/T {"tape name"} |
Overwrites or appends to this tape. Do not use this switch in conjunction with /P. |
|
/N {"media name"} |
Specifies the new tape name. You must not use /A with this switch. |
|
/F {"file name"} |
Logical disk path and file name used wirh /P /G /T. |
|
/D {"set description"} |
Specifies a label for each of the backup sets. |
|
/DS {"server name"} |
Backs up the directory service file for the specified Microsoft Exchange Server. |
|
/IS {"server name"} |
Backs up the Information Store file for the specified Microsoft Exchange Server. |
|
/A |
Performs an append operation. Either /G or /T must be also used. Do not use this switch in conjunction with /P. |
|
/V:{yes|no} |
Verifies the data after the backup is complete. |
|
/R:{yes|no} |
Restricts access to this tape to the Owner group or the administrator. |
|
/L:{f|s|n} |
Specifies the type of log file: f=full, s=summary, n= no log file is created. |
|
/M {backup type} |
Specifies the backup type as normal, copy, daily, incremental, or differential. |
|
/RS:{yes|no} |
Backs up the migrated data files located in Remote Storage. When you back up the %systemroot% folder, Backup automatically backs up the Removable Storage database as well. |
|
/HC:{on|off} |
If available on the tape drive, uses hardware compression. |
|
/SNAP:{on|off} |
Specifies whether the backup should use a volume shadow copy. |
|
/M {backup type} |
Specifies the backup type as normal, copy, daily, incremental or differential. |
|
/? |
Outputs help at the command prompt. |
To eject a tape, the following syntax may be used:
ntbackup eject /tape:n
The /tape:n option is necessary only if there is more than one tape drive installed on the system. The variable n can be a value from 0 through 9 and designates which tape drive should eject the tape.
Enter the following command to back up and verify the C drive, including the local Registry. This restricts access to the Administrators and Backup Operators groups with a fully detailed log of the backup in the file C:\winnt\backup.log.
ntbackup backup c: /b/r/l "c:\winnt\backup.log"
Top |