You can perform backup operations from the command prompt or from a batch file by using the ntbackup command followed by various parameters.
Syntax
ntbackup backup [systemstate] “bks file name” /j {“job name”} [/p {“pool name”}] [/g {“guid name”}] [/t { “tape name”}] [/n {“media name”}] [/f {“file name”}] [/d {“set description”}] [/ds {“server name”}] [/is {“server name”}] [/a] [/v:{yes|no}] [/r:{yes|no}] [/l:{f|s|n}] [/m {backup type}] [/rs:{yes|no}] [/hc:{on|off}] [/um]
Parameters
- Switch: systemstate
Description: Specifies that you want to back up the system state data. When you back up the system state data, all of the system state data is backed up, so the /s switch does not apply. Also, the backup type is forced to normal or copy. - Switch: bks file name
Description: Specifies the name of the backup selection file (.bks file) to be used for the backup operation. A backup selection file contains information on the files and folders that you have selected for backup. You have to create the file by using the graphical user interface (GUI) version of Backup. - Switch: /j {“job name”}
Description: Specifies the job name to be used in the log file. The job name usually describes the files and folders that you are backing up in the current backup job as well as the date and time at which you backed up the files. - Switch: /p {“pool name”}
Description: Specifies the media pool from which you want to use media. This is usually a subpool of the Backup media pool, such as 4mm DDS. If you select this, do not use the following switches: /a /g /f /t . - Switch: /g {“guid name”}
Description: Overwrites or appends to this tape. Do not use this switch in conjunction with /p . - Switch: /t{“tape name”}
Description: Overwrites or appends to this tape. Do not use this switch in conjunction with /p . - Switch: /n {“media name”}
Description: Specifies the new tape name. Do not use /a with this switch. - Switch: /f {“file name”}
Description: Logical disk path and file name. You cannot use the following switches with this switch: /p /g /t . - Switch: /d {“set description”}
Description: Specifies a label for each backup set. - Switch: /ds {“server name”}
Description: Backs up the directory service file for the specified Microsoft Exchange server. The /DS command line switches for NTBackup (with Exchange 5.5) no longer work with NTBackup for Exchange 2000. The Directory Store (DS) switch is not relevant since Exchange 2000 uses the Windows 2000 Active Directory. The Information Store (IS) switch does not apply since the structure of the Information Store has changed from Exchange 5.5 - Switch: /is {“server name”}
Description: Backs up the Information Store file for the specified Exchange server. The /IS command line switches for NTBackup (with Exchange 5.5) no longer work with NTBackup for Exchange 2000. The Directory Store (DS) switch is not relevant since Exchange 2000 uses the Windows 2000 Active Directory. The Information Store (IS) switch does not apply since the structure of the Information Store has changed from Exchange 5.5 - Switch: /a
Description: Performs an append operation. Either /g or /t must be used in conjunction with this switch. Do not use this switch in conjunction with /p . - Switch: /v:{yes|no}
Description: Verifies the data after the backup is complete. - Switch: /r:{yes|no}
Description: Restricts access to this tape for the owner or members of the Administrators group. - Switch: /l:{f|s|n}
Description: Specifies the type of log file: f=full, s=summary, n=none (with n , no log file is created). - Switch: /m {backup type}
Description: Specifies the backup type. It must be one of the following: normal, copy, differential, incremental, or daily. - Switch: /rs:{yes|no}
Description: Backs up the Removable Storage database. - Switch: /hc:{on|off}
Description: Uses hardware compression, if it is available, on the tape drive. - Switch: /um
Description: Finds the first available media, formats it, and uses it for the current backup operation. Use the /p switch to designate a device-type media pool when you use the /um switch so that Backup searches for the appropriate type of media, such as 4mm DDS. When you use the /um switch, Backup searches the following media pools for available media: Free pool, Import pool, Unrecognized pool, and Backup pool. When available media is found, the search stops and the media is formatted and then used without prompting you for input. This command is not applicable to tape loaders and you should only use it if you have a standalone tape device. The /UM switch should be at the end of the command line and should not be enclosed in quotes.
MORE INFORMATION
Examples
The following examples describe how to use the ntbackup command to back up files and folders from the command line or by using a batch file.
Example 1
ntbackup backup \\iggy-multi\c$ /m normal /j “My Job 1” /p “Backup” /n “Command Line Backup 1” /d “Command Line Functionality” /v:yes /r:no /l:s /rs:no /hc:on
If you use the syntax in this example a normal backup that is named “My Job 1” of the remote share \\iggy-multi\c$ occurs. It pulls a tape from the Backup media pool, and names the tape “Command Line Backup 1.” The description of the backup job is “Command Line Functionality.” The backup is verified after the backup job is complete, access is not restricted to the owner/administrator, the logging level is set to “summary only,” Remote Storage data is not backed up, and hardware compression is enabled.
Example 2
ntbackup backup d:\ /j “My Job 2” /a /t “Command Line Backup 1” /m copy
If you use the syntax in this example, a copy backup named “My Job 2” of the local drive D:\ occurs. The backed up files and folders are appended to the tape that is named “Command Line Backup 1.” All other options default to those that are specified in the Backup program.
Example 3
ntbackup backup “@C:\Program Files\Windows NT\ntbackup\data\commandline.bks” /j “My Job 3” /t “Command Line Backup 1” /n “Command Line Backup 2”
If you use the syntax in this example, a backup occurs and it uses the backup type that is specified in the Backup program. It uses the backup selection file that is named “Commandline.bks”, which is located in the C:\Program Files\Windows NT\ntbackup\data\ folder to choose which files to back up. The backup job is named “My Job 3” and it overwrites the tape that is named “Command Line Backup 1” with the new name “Command Line Backup 2.”
Example 4
ntbackup backup \\iggy-multi\d$ /j “Command Line Backup 4” /f “D:\backup.bkf”
ntbackup backup \\iggy-multi\d$ /j “Command Line Backup 5” /f “D:\backup.bkf” /a
ntbackup backup \\iggy-multi\d$ /j “Command Line Backup 6” /f “D:\backup.bkf”
Theses examples show how to perform a backup to a file from the command line. All three examples use the Backup program’s default values for the backup type, verification setting, logging level, hardware compression, and any other restrictions. The first example shows how to backup \\iggy-multi\d$ to the file D:\Backup.bkf. The second example shows how to append the same backup to the same file. The third example shows how to overwrite the file with the same backup. In all three examples, you could substitute a complete UNC name for the drive letter. For example, instead of d:\backup.bkf , you could use \\iggy-multi\d$\backup.bkf as the backup destination.
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
Q241007 How to Back Up a Windows 2000-Based Computer the First Time
Q262006 Windows 2000 Backup Does Not Back Up to CD-R/CD-RW/DVD-R Devices
Q104169 Files Skipped with Windows NT Backup
Q233427 Files and Folders Not Backed Up Using the Ntbackup.exe Tool
Q224006 How to Manually Delete Reports from the Backup Tool
Q240856 Removable Storage Manager Terms and Definitions
Q250468 How Removable Storage Manager and Programs Recognize Media
Q216328 Installed Tape Device Is Not Recognized by RSM
Q288856 Error Message Access Denied to Tape Media
Q239892 Scheduling Unattended Backups Using a Stand-Alone Tape Library
Q264604 Scheduled Backup Jobs May Not Run As Expected
Q267574 Scheduled Backup May Fail After Changing Media
Q243260 Changed Parameters for Scheduled Backup Job May Not Be Saved
Q242881 Advanced Settings Are Not Honored with Scheduled Backups
Q277701 Ntbackup Cannot Restore from Backup Sets Located on Second Tape
Q244805 Restoring Data from a Backup Containing a Missing/Corrupted Tape
Q249694 How to Move a Windows 2000 Installation to Different Hardware
Q275676 XADM: Troubleshooting a Remote Online Backup of Exchange 2000
Q275876 XADM: How to Use NTBackup from a Non-Exchange 2000 Computer