sections in this module | City
College of San Francisco - CS260A Unix/Linux System Administration Module: Periodic Processes |
module list |
at is used to schedule a job to run once at a particular time. It's syntax is straightforward, except for the time specification:
at [ -f jobfile ] -t spectime (System 5)
at [ -f jobfile ] TIME (special at-formatted time)
The environment and working directory from the time of the job submission is saved and used when the job is executed. jobfile is a file of shell commands. If -f is missing, shell commands will be read from standard input. As with cron and anacron, any output of the job is mailed to the user who submitted it.
spectime is a standard System 5 time specification, as given with touch -t:
[[CC]YY]MMDDHHMM
Examples:
12100001 (for one minute past midnight on Dec 10)
0901011200 (Noon on Jan 1, '09 (of the current century))
210901011200 (Noon on Jan 1, '09 (of next century))
On linux, the TIME specification is usually the linux standard format:
[MMDDYY]HH:MM
But at has its own time format, where
the time is followed by an optional date which can be in several
formats (according to the man page)
HH:MM [ MMDDYY
| MM/DD/YY | DD.MM.YY | YYYY-MM-DD ]
Many other time specifications are accepted on linux including HH{am|pm}, midnight, noon, now and teatime. A grammar is used to specify the time specification. The grammar is documented in the timespec file in /usr/share/doc/at*. This is one of the simplest examples of a BNF grammar and is worth a look.
at is used to submit the jobs. It relies on a daemon (atd on linux) that is part of the at [atd] subsystem to run them.
at jobs
at jobs are saved in /var/spool/at (linux) and /var/spool/cron/atjobs (hills).
Jobs that have been submitted may be listed, or removed. There are two ways to do each - the System5-style way (using at) and the Linux (BSD) way using atq, and atrm. Both work on Linux:
System5 syntax:
at -l to list jobs with their ids
at
-d jobid to remove
a job (this option may be -r on a UNIX system)
Linux syntax:
atq to list jobs with ids
atrm jobid to remove a job
Controlling access
The ability to use at is controlled by at.allow and at.deny in the same fashion as cron(1). These files are in /etc on linux and somewhere else on System5 (/usr/lib/cron on hills).
Prev | This page was made entirely
with free software on linux: the Mozilla Project and Openoffice.org |
Next |