Installation guide
Chapter 22. Automated Tasks 201
• teatime — Specifies 4:00PM.
• month-name day year format — For example, January 15 2002 specifies the 15th day of
January in the year 2002. The year is optional.
• MMDDYY, MM/DD/YY, or MM.DD.YY formats — For example, 011502 for the 15th day
of January in the year 2002.
• now + time — time is in minutes, hours, days, or weeks. For example, now + 5 days
specifies that the command should be executed at the same time in five days.
The time must be specified first, followed by the optional date. For more information about
the time format, read the /usr/share/doc/at-
version /timespec text file.
After typing the at command with the time argument, the at> prompt is displayed. Type the
command to execute, press [Enter], and type Ctrl-D. More than one command can be spec-
ified by typing each command followed by the [Enter] key. After typing all the commands,
press [Enter] to go to a blank line and type Ctrl-D. Alternatively, a shell script can be entered
at the prompt, pressing [Enter] after each line in the script, and typing Ctrl-D on a blank line
to exit. If a script is entered, the shell used is the shell set in the user’s SHELL environment,
the user’s login shell, or /bin/sh (whichever is found first).
If the set of commands or script tries to display information to standard out, the output is
emailed to the user.
Use the command atq to view pending jobs. Refer to Section 22.3.3 for more information.
Usage of the at command can be restricted. Refer to Section 22.3.5 for details.
22.3.2. Configuring Batch Jobs
To execute a one-time task when the load average is below 0.8, use the batch command.
After typing the batch command, the at> prompt is displayed. Type the command to ex-
ecute, press [Enter], and type Ctrl-D. More than one command can be specified by typing
each command followed by the [Enter] key. After typing all the commands, press [Enter] to
go to a blank line and type Ctrl-D. Alternatively, a shell script can be entered at the prompt,
pressing [Enter] after each line in the script, and typing Ctrl-D on a blank line to exit. If a
script is entered, the shell used is the shell set in the user’s SHELL environment, the user’s
login shell, or /bin/sh (whichever is found first). As soon as the load average is below 0.8,
the set of command or script is executed.
If the set of commands or script tries to display information to standard out, the output is
emailed to the user.
Use the command atq to view pending jobs. Refer to Section 22.3.3 for more information.
Usage of the batch command can be restricted. Refer to Section 22.3.5 for details.
22.3.3. Viewing Pending Jobs
To view pending at and batch jobs, use the atq command. It displays a list of pending
jobs, with each job on a line. Each line is in the format job number, date, hour, job class, and
username. Users can only view their own jobs. If the root user executes the atq command,
all jobs for all users are displayed.