at (Unix)

from Wikipedia, the free encyclopedia

at ( /usr/bin/at) is a program for the delayed execution of commands. It is a mandatory component of UNIX systems and its properties are defined by the POSIX standard. Most systems similar to the standard have a command of the same name with similar properties.

Working method

For - in principle, restrictions see below - each user account has its own task list (the so-called queue ) which can be empty and contain one or more entries (so-called jobs ). New entries are made with the atcommand and consist of an executable command (or a command list) and a time at which this command (this command list) is to be executed.

atexpects the command to be executed <stdin>, but the time specification as an argument:

echo "cc -o foo foo.c" | at 13:37

causes the compiler run to start at 1:37 p.m. on this day or, if this time has already passed, at 1:37 p.m. on the following day.

at also knows numerous symbolic time information such as B midnight. noon,, nowor also next. In addition, numbers preceded by a plus sign ( +) can be used to further modify the time information. The numerical value is qualified by specifying a unit ( minutes , hours , ..., years ):

echo "cc -o foo foo.c" | at 2pm + 1 week
echo "cc -o foo foo.c" | at 2pm next week

The POSIX standard contains a detailed specification of this grammar and refers to the basic definitions of the grammar conventions .

Permissions

Access to the possibility of queuing jobs is regulated at account level by the two files at.allowor at.deny(the exact location depends on the implementation). Both files only contain (if they exist and have a content) account names separated by newlines.

If neither of the two files exists, no account may place jobs in its queue. If only exists at.allow, then each account mentioned in the file atmay use its queue. If it exists at.deny, every account that is not mentioned in this file is authorized to use its queue. If both files exist, use is prohibited for all accounts that are either at.denymentioned in or at.allownot mentioned in, but allowed for all others.

None of this applies to the account rootwhose authorization to use its queue always applies.

Instructions for use

There is a fundamental difference between standard-compliant implementations and those that are based on BSD . BSD-like ones generally do not evaluate the environment variable TZ( timezone ) when determining the execution time, whereas standards-compliant ones do. However, the BSD behavior can easily be achieved with compliant implementations by:

echo "cc -o foo foo.c" | TZ= at 13:37

variants

Some implementations use the cron - daemon to execute the orders at the right time, others use a separate daemon named atd .

batch

A variant of at is batch . No execution time is transferred here, but a job transferred with batch starts when the load of the machine falls below a threshold value (1.5 by default). With this mechanism, a more even utilization of a machine can be achieved.

Other operating systems

It is also available under Windows NT / 2000 / XP , atbut this command is now obsolete there. The task scheduler should be used instead.

history

The program at appeared for the first time in 1979 as part of the operating system UNIX Time-Sharing System in version 7.

Web links

  • at: execute commands at a later time -  Open Group Base Specification
  • at(1): at, batch, atq, atrm: queue, examine or delete jobs for later execution -  Debian GNU / Linux executables or shell commands man page
  • at(1): at, batch: queue, examine or delete jobs for later execution -  OpenBSD General Commands Manual

Individual evidence

  1. a b The Open Group Base Specifications Issue 7, 2018 edition. Retrieved April 25, 2019 .
  2. The Open Group Base Specifications Issue 7, 2018 edition, 1.3 Grammar Conventions . Retrieved May 16, 2019 .
  3. IBM Knowledge Center, AIX 7.2, at Command . Retrieved May 16, 2019 .