HOW TO: Use the At.exe Command to Schedule a Backup in Windows NT

Article translations Article translations
Article ID: 313289 - View products that this article applies to.
This article was previously published under Q313289
Expand all | Collapse all

On This Page

SUMMARY

This step-by-step article describes how to schedule a tape backup job on a Windows NT Workstation 4.0-based or Windows NT Server 4.0-based computer. The three-part process involves creating a batch file that contains the appropriate backup commands, configuring the Schedule (or Task Scheduler) service to start automatically, and then using the At.exe command to schedule the Windows NT Backup program to run. After you have scheduled the backup job, it will run automatically.

Requirements

  • A computer (that meets the requirements that are listed on the appropriate Hardware Compatibility List) on which Windows NT Server 4.0 or Windows NT Workstation 4.0 is installed.
  • A tape drive (that meets the requirements listed on the Hardware Compatibility List) must be installed in the computer, and a tape must be inserted in the drive.

Using the At.exe Command to Schedule a Backup Job on a Windows NT 4.0-Based Computer

Backup jobs are commonly run after business hours, when users do not have program files open and when system-resource usage is low. Using the At.exe command to schedule a backup job to run automatically can be a great convenience for the administrator, because it eliminates the need for a staff member to be present and manually complete this task.

Creating a Batch File for the Backup Job

The first part of scheduling a backup job is creating a batch file that contains all of the commands that are required to complete the backup job. Windows NT Backup is the program that is used to create the backup job, and this program is included with the Windows NT 4.0 operating system. To create a batch file for the backup job:
  1. Click Start, point to Programs, point to Accessories, and then click Notepad.
  2. In Notepad, type the appropriate commands to complete a backup of the files you want to back up, and then press ENTER. The command line utility that is used to create a backup job is Ntbackup.exe. The syntax for creating a backup job by using Ntbackup.exe is:
    ntbackup backup path nameoptions
    The following list describes the switches that you can use with Ntbackup.exe:

    • /a - Appends the backup set after any existing backup sets, rather than replacing it. This switch is not available for a blank tape.
    • /b - Backs up the local registry, but only if you back up another file from the same volume.
    • /d "text" - Describes the backup set. This description appears when you view the tape catalog.
    • /e - Logs exceptions, such as a summary log. If you do not use this switch, a full detail log is created.
    • /l file name - Assigns a file name to the log file. The default file name is Backup.log, and this file is located in the \Systemroot folder.
    • /r - Limits access to the tape to administrators, backup operators, or the user that created the backup. If this switch is not used, anyone with the restore right can restore the backup set.
    • /t - Specifies the backup type, either Normal, Copy, Incremental, Differential or Daily, and the default backup type is normal. For example, /t Copy, or /t Incremental.
    • /v - Confirms that the files were backed up accurately.
    • /hc: - Enables or disables hardware compression for tape drives that support it, and is either on or off. For example, /hc:on, or /hc:off. The default is hardware compression off.

    For example, to complete a normal backup of drive C, drive D, and the registry on a Windows NT 4.0-based computer, by using hardware compression and verifying that the data was backed up correctly, you would use the ntbackup backup c: d: /b /hc:on /v command.
  3. On the Notepad File menu, click Save As. In the Save As dialog box, select a drive and a folder in which to store the batch file. In the Save as type box, click All Files. In the File name box, type a name for the batch file that uses a .cmd file extension (for example, Backup.cmd). Click Save.
  4. Quit Notepad to complete the process of creating a batch file for the backup job.

Configuring the Schedule Service to Start Automatically

By default, the Schedule service is configured to start manually. To use the At.exe command to schedule an automatic backup job, you must configure the Schedule service to start automatically. After you complete this task, the schedule service starts automatically every time you start the computer.

NOTE: If Internet Explorer 4.0 or later is installed on your Windows NT 4.0-based computer, the Schedule service is called the Task Scheduler service. Task Scheduler may or may not already be configured to start automatically, depending on the version of Internet Explorer you use. To configure the Schedule service to start automatically:
  1. Click Start, point to Settings, click Control Panel, and then double-click Services.
  2. In the Services dialog box, click Schedule (or Task Scheduler if you are running Internet Explorer 4.0 or later), and then click Start. After the service starts, click Startup.
  3. In the Service dialog box, click Automatic, and then click OK.
  4. In the Services dialog box, click Close.
  5. Close Control Panel to complete the process of configuring the Schedule service to start automatically.

Using the At.exe Command to Schedule a Backup Job

Now you're ready to use the At.exe command and the batch file that you created in the "Creating a Batch File for the Backup Job" section of this article to schedule an automatic tape backup job. To use the At.exe command to schedule a backup job:
  1. Click Start, click Run, type cmd, and then click OK.
  2. At the command prompt, type the appropriate commands to schedule the backup job to run automatically by using the batch file that you created in the "Creating a Batch File for the Backup Job" section of this article, and then press ENTER. The command-line utility that is used to schedule a task to run is At.exe. The syntax for using the At.exe command is:
    at \\computer nameid/delete time /interactive/every:date[,...]/next:date[,...] "command"
    The following list describes the switches that you can use with the At.exe command:

    • \\computer name - Specifies a remote computer. If you omit this switch, the commands are scheduled on the local computer.
    • id - Assigns an identification number to a scheduled command.
    • /delete - Cancels a scheduled command. If you use this switch and omit an id, all of the scheduled commands on the computer are canceled.
    • time - Specifies the time that the command is to run. Time is expressed as hour:minutes in 24-hour notation. It runs 00:00 (midnight) though 23:59.
    • /interactive - Allows the backup job to interact with the desktop of the user that is logged on at the time the backup job runs. If omitted, the backup job runs, but is not visible on the desktop.
    • /every:date[,...] - Specifies the weekdays or days of the month that a command is to run. Specify date as one or more days of the week (M,T,W,Th,F,S,Su) or one or more days of the month (by using numbers 1 through 31). If you omit this switch, the default is the current day of the month.
    • /next:date[,...] - Specifies the next weekdays or days of the month a command is to run. If you omit this switch, the default is the current day of the month.
    • command - Specifies the program or batch file to run, such as C:\Backup.cmd.


    For example, to schedule a backup to run at 23:00 every weekday by using the C:\Backup.cmd batch file, you would use the at 23:00 /every:M,T,W,Th,F "c:\Backup.cmd" At.exe command.
  3. At the command prompt, type exit, and then press ENTER to complete the scheduling of an automatic tape backup job by using the At.exe command. The backup will run, automatically, on the days and times that you specified.



REFERENCES

For additional information about how to manually create a tape backup job, click the article number below to view the article in the Microsoft Knowledge Base:
316340 HOW TO: Back Up Files and Folders on a Windows NT 4.0 Computer by Using Windows NT Backup
For additional information about how to restore data from tape, click the article number below to view the article in the Microsoft Knowledge Base:
309340 HOW TO: Use Backup to Restore Files and Folders on Your Computer






Properties

Article ID: 313289 - Last Review: August 17, 2007 - Revision: 1.2
APPLIES TO
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 4.0 Standard Edition
Keywords: 
kbenv kbhowto kbhowtomaster KB313289

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com