Microsoft KB Archive/300439

= How to Use Command Line Parameters With the &quot;Ntbackup&quot; Command =

PSS ID Number: 300439

Article Last Modified on 11/18/2003

-

The information in this article applies to:


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional

-



This article was previously published under Q300439



SUMMARY
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] &quot;bks file name&quot; /j {&quot;job name&quot;} [/p {&quot;pool name&quot;}] [/g {&quot;guid name&quot;}] [/t { &quot;tape name&quot;}] [/n {&quot;media name&quot;}] [/f {&quot;file name&quot;}] [/d {&quot;set description&quot;}] [/ds {&quot;server name&quot;}] [/is {&quot;server name&quot;}] [/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 {&quot;job name&quot;}

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 {&quot;pool name&quot;}

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 {&quot;guid name&quot;}

Description: Overwrites or appends to this tape. Do not use this switch in conjunction with /p.
 * Switch: /t{&quot;tape name&quot;}

Description: Overwrites or appends to this tape. Do not use this switch in conjunction with /p.
 * Switch: /n {&quot;media name&quot;}

Description: Specifies the new tape name. Do not use /a with this switch.
 * Switch: /f {&quot;file name&quot;}

Description: Logical disk path and file name. You cannot use the following switches with this switch: /p /g /t.
 * Switch: /d {&quot;set description&quot;}

Description: Specifies a label for each backup set.
 * Switch: /ds {&quot;server name&quot;}

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 {&quot;server name&quot;}

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.



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 &quot;My Job 1&quot; /p &quot;Backup&quot; /n &quot;Command Line Backup 1&quot; /d &quot;Command Line Functionality&quot; /v:yes /r:no /l:s /rs:no /hc:on

If you use the syntax in this example a normal backup that is named &quot;My Job 1&quot; of the remote share \\iggy-multi\c$ occurs. It pulls a tape from the Backup media pool, and names the tape &quot;Command Line Backup 1.&quot; The description of the backup job is &quot;Command Line Functionality.&quot; The backup is verified after the backup job is complete, access is not restricted to the owner/administrator, the logging level is set to &quot;summary only,&quot; Remote Storage data is not backed up, and hardware compression is enabled.

Example 2
ntbackup backup d:\ /j &quot;My Job 2&quot; /a /t &quot;Command Line Backup 1&quot; /m copy

If you use the syntax in this example, a copy backup named &quot;My Job 2&quot; of the local drive D:\ occurs. The backed up files and folders are appended to the tape that is named &quot;Command Line Backup 1.&quot; All other options default to those that are specified in the Backup program.

Example 3
ntbackup backup &quot;@C:\Program Files\Windows NT\ntbackup\data\commandline.bks&quot; /j &quot;My Job 3&quot; /t &quot;Command Line Backup 1&quot; /n &quot;Command Line Backup 2&quot;

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 &quot;Commandline.bks&quot;, 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 &quot;My Job 3&quot; and it overwrites the tape that is named &quot;Command Line Backup 1&quot; with the new name &quot;Command Line Backup 2.&quot;

Example 4
'''ntbackup backup \\iggy-multi\d$ /j &quot;Command Line Backup 4&quot; /f &quot;D:\backup.bkf&quot;

ntbackup backup \\iggy-multi\d$ /j &quot;Command Line Backup 5&quot; /f &quot;D:\backup.bkf&quot; /a

ntbackup backup \\iggy-multi\d$ /j &quot;Command Line Backup 6&quot; /f &quot;D:\backup.bkf&quot;'''

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:

241007 How to Back Up a Windows 2000-Based Computer the First Time

262006 Windows 2000 Backup Does Not Back Up to CD-R/CD-RW/DVD-R Devices

104169 Files Skipped with Windows NT Backup

233427 Files and Folders Not Backed Up Using the Ntbackup.exe Tool

224006 How to Manually Delete Reports from the Backup Tool

240856 Removable Storage Manager Terms and Definitions

250468 How Removable Storage Manager and Programs Recognize Media

216328 Installed Tape Device Is Not Recognized by RSM

288856 Error Message Access Denied to Tape Media

239892 Scheduling Unattended Backups Using a Stand-Alone Tape Library

264604 Scheduled Backup Jobs May Not Run As Expected

267574 Scheduled Backup May Fail After Changing Media

243260 Changed Parameters for Scheduled Backup Job May Not Be Saved

242881 Advanced Settings Are Not Honored with Scheduled Backups

277701 Ntbackup Cannot Restore from Backup Sets Located on Second Tape

244805 Restoring Data from a Backup Containing a Missing/Corrupted Tape

249694 How to Move a Windows 2000 Installation to Different Hardware

275676 XADM: Troubleshooting a Remote Online Backup of Exchange 2000

275876 XADM: How to Use NTBackup from a Non-Exchange 2000 Computer

Keywords: kbBackup kbhowto w2000ntbackup KB300439

Technology: kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Pro kbwin2000ProSearch kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbWinAdvServSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.