Microsoft KB Archive/814583

= How to use command line parameters with the Ntbackup command in Windows Server 2003 =

Article ID: 814583

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Small Business Server 2003 Standard Edition
 * Microsoft Windows Small Business Server 2003 Premium Edition

-



IN THIS TASK

 * SUMMARY
 * Ntbackup Parameters
 * Examples
 * REFERENCES



For Microsoft Windows 2000 information about this topic, visit the following Microsoft Web site:

http://technet.microsoft.com/en-us/windowsserver/2000/default.aspx



SUMMARY
You can perform backup operations from the command prompt or from a batch file by using the ntbackup backup command followed by various parameters. You can access only the backup option from the command prompt. To restore files, use the Backup and Restore Wizard.

This article describes the parameters available with ntbackup and several examples of how to perform a backup from the command line.

The ntbackup command uses the following syntax:

ntbackup backup [systemstate] &quot;@FileName.bks&quot; /J {&quot;JobName&quot;} [/P {&quot;PoolName&quot;}] [/G {&quot;GUIDName&quot;}] [/T { &quot;TapeName&quot;}] [/N {&quot;MediaName&quot;}] [/F {&quot;FileName&quot;}] [/D {&quot;SetDescription&quot;}] [/DS {&quot;ServerName&quot;}] [/IS {&quot;ServerName&quot;}] [/A] [/FU] [/V:{yes | no}] [/R:{yes | no}] [/L:{f | s | n}] [/M {BackupType}] [/RS:{yes | no}] [/HC:{on | off}] [/SNAP:{on | off}]

back to the top

Ntbackup Parameters
Switch: systemstate

Description: 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.

Switch: @FileName.bks

Description: Specifies the name of the backup selection file (.bks file) to be used for this backup operation. The at (@) character must come before the name of the backup selection file. A backup selection file contains information about the files and folders you have selected for backup. You have to create the file using the graphical user interface (GUI) version of Backup.

Switch: /J {&quot;JobName&quot;}

Description: Specifies the job name to be used in the backup report. The job name generally describes the files and folders you are backing up in the current backup job.

Switch: /P {&quot;PoolName&quot;}

Description: Specifies the media pool where you want to use media. This is generally a subpool of the Backup media pool, such as 4mm DDS. If you select this you cannot use the /A, /G, /F, or /T command-line options.

Switch: /G {&quot;GUIDName&quot;}

Description: Overwrites or appends to this tape. Do not use this switch in conjunction with /P.

Switch: /T {&quot;TapeName&quot;}

Description: Overwrites or appends to this tape. Do not use this switch in conjunction with /P.

Switch: /N {&quot;MediaName&quot;}

Description: Specifies the new tape name. You must not use /A with this switch.

Switch: /F {&quot;FileName&quot;}

Description: Logical disk path and file name. You must not use the following switches with this

Switch: /P /G /T

Switch: /D {&quot;SetDescription&quot;}

Description: Specifies a label for each backup set.

Switch: /DS {&quot;ServerName&quot;}

Description: Backs up the directory service file for the specified Microsoft Exchange server.

Exchange version: The /DS switch works only with Microsoft Exchange Server 5.5. The /DS switch does not work with Microsoft Exchange 2000 Server or Microsoft Exchange Server 2003.

Switch: /IS {&quot;ServerName&quot;}

Description: Backs up the Information Store file for the specified Microsoft Exchange server.

Exchange version: The /IS switch works only with Microsoft Exchange Server 5.5. The /IS switch does not work with Microsoft Exchange 2000 Server or Microsoft Exchange Server 2003.

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: /FU

Description: Enables a &quot;file unbuffered&quot; setting to bypass the cache manager. This change provides a number of benefits during the disk-to-disk backup process:
 * Sustainable throughput over time
 * Reduction in processor utilization: on average, peak utilization is reduced to 30 percent
 * Elimination of impacts to the system process during the backup job

Note The /FU switch is available only in the revised version of Ntbackup.exe that is included with Windows Server Service Pack 1. You can also obtain this revised version by downloading it as a hotfix. To do this, click the following article number to view the article in the Microsoft Knowledge Base:

839272 System performance is negatively affected when Ntbackup.exe writes to a destination .bkf file

Switch: /V:{yes | no}

Description: Verifies the data after the backup is complete.

Switch: /R:{yes | no}

Description: Restricts access to this tape to 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 (no log file is created).

Switch: /M {BackupType}

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 migrated data files located in Remote Storage. You do not have to use the /RS command-line option to back up the local Removable Storage database (that contains the Remote Description: Storage placeholder files. When you back up the %Systemroot% folder, Backup automatically backs up the Removable Storage database also.

Switch: /HC:{on | off}

Description: Uses hardware compression, if available, on the tape drive.

Switch: /SNAP:{on | off}

Description: Specifies whether the backup must use a volume shadow copy.

Note The SNAP switch is ignored in Microsoft Windows Server 2003 Service Pack 1 (SP1) and in later versions.

Switch: /M {BackupType}

Description: Specifies the backup type. It must be one of the following: normal, copy, differential, incremental, or daily.

Switch: /?

Description: Displays help at the command prompt.

back to the top

Examples
The following examples show how to use the ntbackup command to back up files and folders from the command line or by using a batch file. Note that if you do not specify an option, it applies the settings that you set in the graphical version of the backup program.

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; &quot; /v:yes /r:no /l:s /rs:no /hc:on

This example creates a normal backup of the remote share \\iggy-multi\c$ and names it &quot;My Job 1&quot;. It pulls a tape from the Backup media pool, and names the tape &quot;Command Line Backup 1.&quot; You can substitute &quot; &quot; in the command with the actual description of your backup. This backup is verified after the backup job is complete. Access is not restricted to the owner or the administrator, and 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

This example generates a copy backup of the local drive D:\ and names the backup &quot;My Job 2&quot;. The backed up files and folders are added to the tape that is named &quot;Command Line Backup 1.&quot;

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;

This example generates the type of backup that you specified in the graphical version of the Backup program. To specify the files that are backed up, this example uses the &quot;Commandline.bks&quot; backup selection file located in the C:\Program Files\Windows NT\Ntbackup\Data folder. The backup job is named &quot;My Job 3&quot;. 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
The following three commands perform a backup to a file from the command line:

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; 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 can substitute a complete UNC name for the drive letter. For example, instead of d:\backup.bkf, you can use \\iggy-multi\d$\backup.bkf as the backup destination.

All three examples use the Backup program's default values for the backup type, verification setting, logging level, hardware compression, and any other restrictions.

To start the graphical version of the Backup program, click Start, point to All Programs, point to Accessories, point to System Tools, and then click Backup.

back to the top

