TechTutorials - Free Computer Tutorials  

Scheduling Backups in Windows NT 4.0 

Added: 06/27/2001, Hits: 3,824, Rating: 0, Comments: 0, Votes: 0
Add To Favorites | Comment on this article
Windows NT did not include a very easy method for scheduling automated backups. In this tutorial, we will show you how to not only backup a drive, but your Exchange Server data as well.

In order to accomplish a scheduled backup, there are a couple of tools that you will need to be familiar with. NTbackup is the backup utility that can be accessed at start > programs > administrative tools > Backup. The scheduling utility is called AT.EXE and is used from a command prompt. In order for this utility to work correctly, you need to make sure that the scheduling service is set to started and automatic. This can be done in the "Services" Control Panel.

The AT utility allows you to schedule commands or batch files to be run on designated dates or times. When scheduling a backup, there will probabaly be multiple configuration options and commands that you will wish to use. For this reason, a batch file will need to be created.

Creating the Batch File
To get started creating your batch file, open up a text editor such as notepad. Below we will list some of the different options that you can configure in your batch file followed by examples. These options take the place of the configurable options that you would see when using the backup application in GUI mode.

PathIndicates the folders that are to be backed up. Note: You cannot select individual files to be backed up using a batch file.
/aThis switch tells NTBackup that you want to append the data from the next backup to the end of the last backup. If this switch is not used, the data on the tape will be overwritten.
/bThis switch will backup the local registry.
/d "text"Provides a description for the backup set.
/e Only used if the /l parameter is used and indicates that the log should only include a summary of the backup rather than full details.
/hc:{on|off}Indicates whether or not you want to use hardware compression. If your tape drive supports compression, this option will compress the data and allow you to store more data on the tape.
/l "filename"Creates a log file with the filename specified that contains backup details. This is useful for troubleshooting.
/t {type}Specifies the type of backup to run. See the next table for more details.
/rRestricts access to the backup data.
/tape:{#}Tells backup which drive to back up to using the drive number when multiple tape drives are installed.
/vVerifies that the data was backed up to the tape.

The following table lists the different backup types that can be specified using the /t parameter described in the table above.

NormalThis is a full backup - backs up everything that is selected regardless as to whether or not the archive bit is set.
CopyAlso a full backup but the archive bit is not reset after the files have been copied.
DifferentialOnly backs up files that have the archive bit set and doesn't reset the bit afterward.
IncrementalSame as differential except the archive bit is reset afterward.
DailyBacks up all files that were modified that day and doesn't reset the archive bit.

Batch File Examples
Now that we have looked at the various options that you can configure, lets take a look at some examples:

Example #1
ntbackup backup c: /t normal

The above batch file will perform a normal backup on the C drive.

Example #2
net use s: \computer_namedirectory /u:domain_nameusername
ntbackup backup c: s: /t incremental /b
net use s: /delete

This example first connects to a remote location as specified by \computer_namedirectory and maps it to the "S" drive. The /u parameter specifies the domain name and username that will be used to login to the computer - NOTE: The username specified must have backup rights in order for this to work. On the second line, the backup utility is told to run an incremental backup on the C:(local) and S:(network) drives. The /b switch tells NTBackup to backup the local registry. After this is complete, the 3rd line will disconnect from the S drive.

Example #3
ntbackup backup c:windowssystem /t normal /hc:on /d "Backup1" /l "c:backup.log"
ntbackup eject

This example tells backup to perform a normal backup on the "System" directory with hardware compression enabled. The /d parameter will label the backup job as "Backup1". The /l parameter tells backup to create a log file called "backup.log" and place it on the root of the C: drive. Once the backup is complete, the 3rd line tells NTbackup to eject the tape(this prevents the tape from being accidentally recorded over).

Your batch file can include many combinations of the above examples. Once your batch file is complete, save it with a name and in a location that you will remember. Give the file either a .cmd or .bat extension.

Backing Up Exchange Server
Exchange has an agent that will allow you to backup your Directory Store and Information Store by placing the following string in your batch file:

ntbackup backup DS \servername IS \servername /B /T normal

In the above example, you would need to configure servername for your environment and the /T parameter to match the type of backup that you wish to perform. You can also utilize the other parameters offered in the previous examples.

Now that we have created the batch file, we need to use the AT.EXE utility to schedule the backup. The AT utility has a variety of configurable options as follows:

\computer_nameSpecifies a remote computer.
idAssigns an identification number for the scheduled job.
/deleteCancels all scheduled commands
/tSpecifies the time the command is to run (24 hour time notation from 00:00 to 23:59)
/interactiveAllows the job to interact with the desktop of the user who is logged on at the time the job runs.
/every:date[,]Specifies the weekdays or days of the month a command is to run. Weekdays are abbreviated M, T, W, Th, F, S, Su. A number between 1 and 31 can be used to specify specific day(s) of the month.
/next:date[,]Specifies the next weekdays or days of the month a command is to run.
"command"Specifies the program or batch file to run.

Now let's take a look at a few examples:

Example #1
at 22:00 /every:M,W,F c:backupbackup.bat

This command will run a batch file called backup.bat located in the C:backup directory every Monday, Wednesday and Friday at 10pm.

Example #2
at 3:00 /next:15 c:backupbackup.bat

The above example will run backup.bat at 3am on the next 15th of the month.

That should be enough information to get you started.

Good Luck!

Comments (0)

Be the first to comment on this article

Related Items

7 Seconds Resources, Inc.

IT Showcase