16.2.1. Configuring At Jobs
To schedule a one-time job at a specific time, type the command at time
, where time
is the time to execute the command.
The argument time
can be one of the following:
HH:MM format — For example, 04:00 specifies 4:00 a.m. If the time is already past, it is executed at the specified time the next day.
midnight — Specifies 12:00 a.m.
noon — Specifies 12:00 p.m.
teatime — Specifies 4:00 p.m.
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 five days from now.
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 press Ctrl+D . Multiple commands 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 press Ctrl+D . Alternatively, a shell script can be entered at the prompt, pressing Enter after each line in the script, and pressing 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 output, the output is emailed to the user.