
The ECN No Name Newsletter is no longer being published. This is an archived issue.
[previous article]At is a command that allows a user to execute commands, such as running a program or printing a document, at a specified time and date. By using at, users can take advantage of the hours when the system is the least busy. At is particularly helpful when running large jobs because the user does not need to be present in to order execute the command and it does not inconvenience other users.
In order to use at, an at-file must be created. For example, suppose the user wants to print the file chapter.2. The at-file could look similar to the following example. (In this example, the at-file is named at.file.)
#!/bin/csh -f
lpr -Pmsa chapter.2
-
-
-
"at.file"
The first line of this file is the command line for fast C shell startup. This command line minimizes the probability of a problem occurring, such as poor shell recognition. The second line tells the system to print (lpr) the file (chapter.2) to the printer, which is named -Pmsa.
Since an at-file has been created, the at command can be issued. A basic command line consists of
at [-csm] time [date] atfile
The [-csm] are the shell and mail options. The "c" indicates the C shell. The "s" indicates the Bourne shell. The "m" indicates that the user wants to receive mail; mail will be sent regardless of whether or not a job is successfully run.
The time is indicated by digits. One or two digits signify hours, while three or four digits signify hours and minutes. If am or pm are not used after the digits, then military time should be used.
The date can also be indicated by several options.. A month name and day number (Jan. 1), a day of the week (Wed.), digits (11), today, and tomorrow are the some of the options.
In keeping with the previous example, the user could issue the following at command line:
at -cm 215am 116 at.file
Notice that the C shell and mail options are the only ones specified. This is consistent with the user's at-file; the user specified the C shell in the first line of the at-file.
If the user wants to see the at queue or remove the job, the commands atq and atrm are used, respectively. At queue lists the jobs in a chronological order, and atrm will remove the job by indicating the job number.
At is very useful; it is unfortunately unable to execute a program repeatedly. For those programs needing repeat execution, crontab should be used. Type "man at" or "man crontab" for more information.