Anda di halaman 1dari 4

Running NT Backup from the Command Line I have discussed how to use the GUI interface for NT Backup

to perform backups and restores. However, in some instances you don't want to work with the GUI interface, so NT Backup provides a set of parameters that can be used to call NT Backup from the command line to perform different functions. The syntax for NTBACKUP is as follows:
NTBACKUP operation path [/a] [/v] [/r] [/d "text"] [/b] [/hc:{on|off}] [/t {option}] [/l "filename"] [/e] [/tape:{N}] operation

Specifies whether NTBACKUP should perform a backup or a restore. Accepted values are BACKUP or RESTORE. Tells NTBACKUP which file or path should be backed up or restored. You can enter more than one entry here. Use this option to have the backup appended to the end of an existing tape. If you don't specify this option, NTBACKUP starts at the beginning of a tape and replaces any previously backed up data contained on the tape. Specifying this option has NT verify all data after performing the backup. Using this option takes much longer, and if used to back up data from a network share it effectively doubles the amount of network traffic. Tells NTBACKUP to mark this tape as a restricted access tape. Tapes marked as such can be read only by the owner and by members of the backup operators and administrators groups. Supplying this uses the text in quotes as a description of the tape set. For instance, you might use this to mark your tape with an identifying number or with other information such as "Backup of FARINELLI workstation on 1/1/96." Including this option causes NTBACKUP to include a copy of the local registry on the tape. Note that this can be used only to back up the local registry. It cannot be used to back up the registry of a remote system. Supplying the switch /hc:on tells NTBACKUP to use hardware compression, which on many systems effectively doubles the storage capacity. Using /hc:off causes NT to disable hardware compression. To use this option, your tape device must support hardware compression. This option is not effective when used with the /a option,

path

/a

/v

/r

/d "text"

/b

/hc:{on|off}

because if you are appending your backup to a tape, NTBACKUP automatically uses whatever compression option was used for the first backup job on the tape.
/t {option}

Tells NTBACKUP whether to perform a Normal, Incremental, Differential Backup, Copy, or Daily Backup. Accepted values for option are NORMAL, INCREMENTAL, DIFFERENTIAL, COPY, and DAILY. Tells NTBACKUP to save a log file for the job in file "filename." By default, NTBACKUP uses a file called %SYSTEM_ROOT%\XXX. Supplying this option causes only exceptions to be written to the backup log. Without this option, NTBACKUP includes complete backup descriptions for the job. When backing up large numbers of files, the backup log can grow extremely large. Using this option can help keep the log to a more manageable size. NT supports up to 10 tape drives. Use this option if you have more than one drive installed. Tape drives are designated as 0 to 9. By default, NT uses tape device 0.

/l "filename" /e

/tape:{N}

Using the NT Scheduler Service to Schedule Regular Backups Although NT Backup does not have a built-in scheduling mechanism, you can use the scheduler service built into the NT system to run regular backup jobs automatically. Before you can do this, you need to make sure the scheduler service has been started and the scheduler user has the appropriate user rights on the local system and on any system you need to back up. Let's assume your system has two volumes: C and D. To perform a full backup of your system every Friday night at 10:00 pm and a differential backup of your system every Monday, Tuesday, Wednesday, and Thursday night at 10:00 pm, you need two scripts, as follows:
backfull.bat: ntbackup backup c: d: /v /d "Full System Backup" /b /t normal /l "c:\users\backup\backfull.log" /e backdiff.bat: ntbackup backup c: d: /v /d "Differential System Backup" /b /t differential /l "c:\users\backup\backdiff.log" /e

Create a directory for these scripts. c:\users\backup might be a good location. Now you have two files: c:\users\backup\backfull.bat and c:\users\backup\backdiff.bat. You then set up the jobs in the system scheduler by issuing the following two commands:
at 22:00 /interactive /every:friday "c:\user\backup\backfull.bat" at 22:00 /interactive /every:monday,tuesday,wednesday,thursday "c:\user\backup\backdiff.bat"

Now you're all set. Each morning you can simply take out the tape for the previous night and insert a new tape. Backing Up Remote Volumes You can use the scheduler service and NTBACKUP to back up remote volumes, but you must take some additional steps. By default, the scheduler user runs using the built-in SYSTEM account. When you run NTBACKUP from the scheduler service, it runs in whatever user context the scheduler service is using. The built-in SYSTEM account cannot make remote network attachments, so it cannot back up remote network shares. If you want to back up remote network shares in this way, you need to run the scheduler service with a user context that has both backup and restore user rights and has permission to access files on the remote system. Once you have the scheduler service running as a user with backup and restore user rights, and permissions to access the remote network shares you want to back up, you can create a batch file like the following to back up a share called CLIENTS from a machine called SAMSON:
net use k: \\SAMSON\CLIENTS net use k: /d

NOTE: Remember that if you tell NTBACKUP to verify data backed up from a network share, you double the amount of network traffic. Assuming you save this batch file as c:\users\backup\samson.bat, you could have NT's scheduler service run this batch file every weeknight at 10:00 pm by issuing this command:
at 22:00 /interactive /every:monday,tuesday,wednesday,thursday,friday "c:\user\backup\samson.bat"

NOTE: If you include a /b switch in a backup command like the one contained in the batch file listed earlier, it backs up the registry on the computer that is running NTBACKUP, not the computer whose share it is you are backing up. Using NTBACKUP, there is currently no method to back up the registry on a remote machine.

Anda mungkin juga menyukai