|
|
coherent
at Command at
Execute commands at given time
aatt [ -vv ] [ -cc _c_o_m_m_a_n_d ] _t_i_m_e [ [ _d_a_y ] wweeeekk ] [ _f_i_l_e ]
aatt [ -vv ] [ -cc _c_o_m_m_a_n_d ] _t_i_m_e _m_o_n_t_h _d_a_y [ _f_i_l_e ]
at executes commands at a given time in the future.
If the -c option is used, aatt executes the following command. If
file is named, at reads the commands from it. If neither is
given, at reads the standard input for commands.
If time is a one-digit or two-digit number, aatt interprets it as
specifying an hour. If time is a three-digit or four-digit num-
ber, aatt interprets it as specifying an hour and minutes. If _t_i_m_e
is followed by aa, pp, nn, or mm, at assumes AAMM, PPMM, nnoooonn, or mmiidd-
nniigghhtt, respectively; otherwise, it assumes that time indicates a
24-hour clock.
For example, the command
at -c "time | msg henry" 1450
set the ttiimmee command to be executed at 2:50 PM, and pipe ttiimmee's
output to the mmssgg command, which will pass it to the terminal of
user hheennrryy. Note that argument to the -cc option had to be
enclosed in quotation marks because it contains spaces and
special characters; if this were not done, aatt would not be able
to tell when the argument ended, and so would generate an error
message. Also note that if you wish pass information to a user's
terminal with the aatt command, you must tell aatt to whom to send
the information. The command
at 250p commandfile
will set the file ccoommmmaannddffiillee to be read and executed at 2:50 PM.
Note that it is _n_o_t necessary to use the file's full path name.
Also, if the suffix pp were not appended to the time, the file
would be set to be read at 2:50 AM.
The time set in aatt's command line is _n_o_t the exact time that the
command is executed. Rather, the daemon cron wakes up the file
/usr/lib/atrun periodically to see if any commands have been
scheduled commands to be executed at or before that time. The
frequency with which cron executes atrun determines the
``granularity'' of at execution times; it may be changed by
editing the file /usr/lib/crontab. For example, the entry
COHERENT Lexicon Page 1
at Command at
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/lib/atrun
sets /uussrr/lliibb/aattrruunn to be executed every five minutes. Thus, the
aatt command that is set, for example, to 2:53 PM will actually be
executed at 2:55 PM. atrun executes specified commands when it
discovers that the given time is past; therefore, at commands are
executed even if the system is down at the specified time or if
the system's time is changed.
The aatt command has two forms, as shown above. In the first form,
the option day names a day of the week (lower case, spelled out).
If week is specified, at interprets the given time and day as
meaning that time and day the following week. For example, the
command
at -c "time | msg henry" 1450 friday week
executes ttiimmee and sends its output to hheennrryy's terminal one week
from Friday at 2:50 PM.
In the second form given above, month specifies a month name
(lower case, spelled out) and the number day specifies a day of
the month. For example, the command
at 1450 july 4 commandfile
set the file ccoommmmaannddffiillee to be read at 2:50 PM on July 4.
If the -v flag is given, at prints the time when the commands
will be executed, giving you enough information to plan for the
execution of the command. For example, if it is now August 13,
1990, at 2:30 PM, and you type the command
at -v -c "/usr/games/fortune | msg henry" 1435
aatt will reply:
Tue Aug 13 14:35:00
indicating that the command will be executed five minutes from
now. However, if you type
COHERENT Lexicon Page 2
at Command at
at -v -c "/usr/games/fortune | msg henry" 1435 august 10
aatt will reply
Sun Aug 10 14:35:00 1991
which indicates that on Sunday, August 10 of next year, at 2:35
PM, the COHERENT system will print a ffoorrttuunnee onto your terminal.
Should you create such a long-distance aatt file by accident, you
can correct the error by simply deleting the file that encodes it
from the directory /uussrr/ssppooooll/aatt. The file will be named after
the time that it is set to execute, plus a unique two-character
suffix, should more than one command be scheduled to run at the
same time. For example, the file for the above command would be
named 99110088110011443355.aaaa.
Finally, note that the current working directory, exported shell
variables, file creation mask, user id, and group id are restored
when the given command is executed.
***** Files *****
/bbiinn/ppwwdd -- To find current directory
/uussrr/lliibb/aattrruunn -- Execute scheduled commands
/uussrr/ssppooooll/aatt -- Scheduled activity directory
/uussrr/ssppooooll/aatt/ _y_y_m_m_d_d_h_h_m_m._x_x -- Commands scheduled at given time
***** See Also *****
at, commands, cron
COHERENT Lexicon Page 3
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.