Section 3.7. Backing Up Your Machines


3.7. Backing Up Your Machines

The oft-neglected process of backing up your machines and the critical data they contain is perhaps the most effective insurance policy you can take out for your business. It's like exercise: although nearly everyone knows that it's an excellent idea and vital to health, not everyone does it. Fortunately, Server 2003 includes a backup utility in the box which performs this function at a basic level. This section will discuss how to use the GUI frontend, Backup, and how to access the same features from the command-line using the core NTBACKUP program for enhanced automation possibilities.

NTBACKUP can perform several different types of backups.


Copy

Copies all selected files but does not mark each file with a cleared archive attribute. Copy backups can be performed completely independently of other backup procedures without affecting their sets.


Daily

A daily backup backs up all files modified since the last day. With a daily backup, the archive attribute is not cleared.


Differential

A differential backup copies new files and other files modified since the last normal or incremental backup. It does not mark files as having been backed up. To restore a complete backup, you'll need the last normal backup (covered later) in addition to the last incremental backup.


Incremental

An incremental backup backs up files created or modified since the last normal or the last incremental backup. It does mark files as having been backed up. To restore a complete backup, you'll need the last normal backup (covered next) in addition to the last incremental backup.


Normal

A normal backup (sometimes called a full backup) copies all selected files and marks each file as backed up. You create these to start a backup scheme, and they're used in conjunction with differential and/or incremental backups, depending on what you choose. Normal backups can be used independently; they don't require another accompanying set.

The files that NTBACKUP creates are very large, even when compared with an eye for price to commercial products such as Veritas BackupExec. Keep that in mind when justifying the cost of sticking with the built-in product versus investing the money in a third-party backup product.


3.7.1. Using Backup from the GUI

To back up the contents of your server to a file or to another removable media device using the GUI, follow these steps.

  1. From the Start Menu, select All Programs Accessories System Tools Backup. The wizard starts by default. You can use the wizard, but I'll describe a more direct and flexible method, so click the Advanced Mode link.

  2. Navigate to the Backup tab, and then select New from the Job menu.

  3. Click the box to the left of a file or folder to select the files and folders you want to back up.

  4. In Backup Destination, choose File (the default selection) if you want to back up to a file on disk. Choose another device if you want to back up to a tape or something similar.

  5. In Backup Media or File Name, if you are backing up to a file, choose a location for the backup (.bkf) file. Otherwise, choose the tape you want to use.

  6. Make sure you've configured this backup operation the way you want by selecting Options from the Tools menu and verifying the choices there.

  7. Click the Start Backup button, and then make any changes to the Backup Job Information dialog box.

  8. Click Advanced to configure options such as compression and verification. Then click OK.

  9. Click Start Backup.

You should note the following considerations if you use either Removable Storage or Remote Storage. You should make a note to back up the contents of:

%systemroot%\System32\Ntmsdata

and:

%systemroot%\System32\Remotestorage

on a regular basis. If you don't, it's possible (although somewhat unlikely) that Removable/Remote Storage data could be lost and unrestorable.


3.7.2. The Command-Line: NTBACKUP

To back up to a file or tape from the command-line, use:

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

Table 3-3 explains the various options.

Table 3-3. NTBACKUP command-line options

Option

Explanation

@FileName.bks

Specifies the name of the backup selection file (.bks file) to be used. The @ character must precede the name of the backup selection file. The .bks file must be created using the GUI version of NTBACKUP, and is essentially a summary of what set of files a particular job is supposed to back up.

Alternatively, you could supply the path to the drive or file to back upfor example, D:\.

/J "JobName"

Specifies the job name to be filled in the post-backup report.

/F "FileName"

If you back up to a file, this specifies the path of that file.

You cannot use the /P, /G, and /T switches when using /F.

/T "TapeName"

If you back up to a tape, this specifies the tape to which to overwrite or append data.

/P "PoolName"

If you back up to a tape, this specifies the media pool to use. This is usually a subpool of the media specified with the /N switch.

You cannot use the /A, /G, /F, and /T switches when using /P.

/G "GUIDName"

If you back up to a tape, this specifies the tape to which to overwrite or append data.

You cannot use the /P switch when using /G.

/N "MediaName"

If you back up to a tape, this specifies the new tape name.

You cannot use the /A switch when using /N.

/A

If you back up to a tape, this specifies to perform an append operation.

You must use either the /G or /T switch when using /A. You cannot use the /P switch when using /A.

/D "SetDescription"

Specifies a label for each backup.

/DS "ServerName"

Backs up the directory service information and contents for an Exchange Server machine.

/IS "ServerName"

Backs up the Information Store on an Exchange Server computer.

/V:yes | no

Specifies whether to perform a verification pass when the backup is complete.

/R:yes | no

Restricts access to the tape to members of the Administrators group only.

/L:f | s | n

Specifies the type of log file to be written. "f" indicates a full file, "s" indicates a summary, and "n" instructs NTBACKUP not to write any logs.

/M "BackupType"

Specifies the type of backup. Replace BackupType with one of the following: copy, daily, differential, incremental, or normal.

/RS:yes | no

Backs up the migrated datafiles located in Remote Storage. (This also is backed up when you select the system root folder to be included in a job.)

/HC:on | off

If available, uses hardware compression for the job.

/SNAP:on | off

Specifies whether to use a volume shadow copy for the backup.

Systemstate

Includes system state data (registry and other critical system information) in the backup.


Using NTBACKUP from the command-line has two important limitations. One, you cannot restore files, and two, you cannot back up system state data on a remote computer.

Actually, you can back up system state data on a remote computercheck out Hack 93 in Mitch Tulloch's book Windows Server Hacks by O'Reilly.


Switches /V, /R, /L, /M, /RS, and /HC default to the setting in the GUI version of Backup unless you explicitly set them on the command-line.

3.7.3. Sample Command-Line Scenarios

In this section, I'll offer some possibilities for automating backups using the command-line. You should find that it's easy to modify the examples provided here (if they don't fit your use the first time) to extend their capabilities.

The first example executes a normal backup named "Nightly" of the network share \\winsrv-1\c$. This example selects media from the Tapes pool and names the tape "Nightly NTBACKUP 1." The description of the backup job is "Standard evening backup." A verification pass is done, access to the tape is open to all, only a summary log will be produced, Remote Storage data is not backed up, and hardware compression will be used.

 ntbackup backup \\winsrv-1\c$ /m normal /j "Nightly" /p "Tapes" /n  "Nightly NTBACKUP 1" /d "Standard evening backup" /v:yes /r:no /l:s  /rs:no /hc:on

The next example starts a copy backup named "Lunchtime" of the E: drive on the server itself. The backed-up files and folders are appended to the tape named "Nightly NTBACKUP 1." Because no other switches are present, the default settings in the GUI version of Backup are used.

ntbackup backup e:\ /j "Lunchtime" /a /t "Nightly NTBACKUP 1" /m copy

The following example performs a backup using the GUI Backup program's current setting. The program looks at the file weekend-backup.bks, located in the C:\Program Files\Windows NT\ntbackup\data\ directory, to select the particular data to back up. The backup job is named "Weekend" and it overwrites the tape named "Weekend NTBACKUP 1" with the new name "Weekend NTBACKUP 2." It also includes system state information.

 ntbackup backup systemstate "@C:\Program Files\Windows NT\ntbackup\data\ weekend-backup.bks" /j "Weekend" /t "Weekend NTBACKUP 1" /n "Weekend  NTBACKUP 2"

The final example backs up a remote share to a file named backup.bkf using the Backup program's default values for the backup type, verification setting, logging level, hardware compression, and access restrictions.

ntbackup backup \\win-srv2\acctg$ /j "To File on MWF" /f "E:\backup.bkf"

When running this command again, if you want to append another backup to the existing file, simply add the /a switch as shown. Otherwise, you will overwrite the existing file automatically.

 ntbackup backup \\ntsrv-5\sales-execs$ /j "To File on TH" /f "E:\ backup.bkf" /a



    Learning Windows Server 2003
    Learning Windows Server 2003
    ISBN: 0596101236
    EAN: 2147483647
    Year: 2003
    Pages: 149

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net