Using NTBACKUP !Command line 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. 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
This example will perform a normal backup named "My Job 1" of the remote share \\iggy-multi\c$. It will pull a tape from the Backup media pool, and name the tape "Command Line Backup 1." The description of the backup job will be "Command Line Functionality." The backup will be verified once the backup job is complete, access will not be restricted to the owner/administrator, the logging level will be set to summary only, Remote Storage data will not be backed up, and hardware compression will be enabled.Example 2: 
ntbackup backup d:\ /j "My Job 2" /a /t "Command Line Backup 1" /m copyThis example will perform a copy backup named "My Job 2" of the local drive D:\. The backed up files and folders will be appended to the tape named "Command Line Backup 1." All other options will default to those 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"This example will perform a backup using the backup type that is specified in the Backup program. It will use the backup selection file named Commandline.bks, located in the C:\Program Files\Windows NT\ntbackup\data\ directory to choose which files to backup. The backup job will be named "My Job 3" and it will overwrite the tape 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"
The above 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 a complete UNC name could be substituted for the drive letter (that is, instead of d:\backup.bkf, the user could specify \\iggy-multi\d$\backup.bkf as the backup destination).光说不练之龙飞虎