Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cron(C)

kill(C)

mail(C)

nice(C)

ps(C)

sh(C)

queuedefs(F)


     AT(C)                                      UNIX System V



     Name
          at, batch - executes commands at a later time


     Syntax
          at time [ date ] [ increment ]

          at -r job-id ...

          at -l[ job-id ... ]

          at -qletter time [ date ] [ increment ]

          batch


     Description
          at and batch both accept  one  or  more  commands  from  the
          standard  input to be executed at a later time. at and batch
          differ in the way the set of commands, or job, is scheduled:
          at  allows  you  to  specify  a  time when the job should be
          executed, while batch executes the job when the system  load
          level  permits.   After a job is queued with either command,
          the program writes a job identifier (a number and a letter),
          along with the time the job will execute, to standard error.

          at takes the following arguments:

          time The time can be specified as 1, 2, or 4  digits.   One-
               and  two-  digit  numbers  are  taken to be hours, four
               digits  to  be  hours  and  minutes.   The   time   can
               alternately  be specified as two numbers separated by a
               colon, meaning hour:minute.  A suffix am or pm  can  be
               appended; otherwise a 24-hour clock time is understood.
               The suffix zulu can be used to indicate Greenwich  Mean
               Time  (GMT).  The special names noon, midnight, and now
               are also recognized.

          date An optional date can be specified  as  either  a  month
               name followed by a day number (and possibly year number
               preceded by an optional comma) or a  day  of  the  week
               (fully  spelled  or  abbreviated  to three characters).
               Two  special  ``days,''   today   and   tomorrow,   are
               recognized.   If  no date is given, today is assumed if
               the given hour is greater than  the  current  hour  and
               tomorrow  is assumed if it is less.  If the given month
               is less than the current month (and no year is  given),
               next year is assumed.

          increment
               The time and optional date arguments  can  be  modified
               with  an  increment  argument of the form ``+n units'',
               where  n  is  an  integer  and  units  is  one  of  the
               following:  minutes,  hours,  days,  weeks,  months, or
               years.  The singular form is also  accepted,  and  ``+1
               unit''  can  also  be  written  ``next  unit''.   Thus,
               legitimate commands include:

                 at 0815am Jan 24
                 at 8:15am Jan 24
                 at now + 1 day
                 at 5 pm Friday next week

          -r job-id ...
          Removes the specified job or jobs  previously  scheduled  by
          the at or batch command. job-id is a job identifier returned
          by at or batch.  Unless you are the super-user, you can only
          remove your own jobs.

          -l [ job-id ... ]
          Lists schedule times of specified jobs.  If no  job-ids  are
          specified,  lists  all  jobs  currently  scheduled  for  the
          invoking user. Unless you are the super-user, you  can  only
          list your own jobs.

          -qletter
          Places the specified job in a queue denoted by letter, where
          letter  is  any  lowercase  letter from ``a'' to ``z''.  The
          queue  letter  is  appended  to  the  job  identifier.   The
          following letters have special significance:
                                a   at queue
                                b   batch queue
                                c   cron queue

          For more information on the use of different queues, see the
          queuedefs(F) manual page.

          batch takes no arguments; it submits  a  job  for  immediate
          execution at lower priority than an ordinary at job.

          at and batch jobs are executed using sh(C).  Standard output
          and standard error output are mailed to the user unless they
          are redirected elsewhere.  The shell environment  variables,
          current  directory,  umask, and ulimit are retained when the
          commands are executed.  Open file  descriptors,  traps,  and
          priorities are lost.

          Users are permitted to use  at  and  batch  if  their  names
          appear  in  the  file  /usr/lib/cron/at.allow.  If that file
          does not exist, the file /usr/lib/cron/at.deny is checked to
          determine  if a given user should be denied access to at and
          batch.  If neither file exists,  only  root  is  allowed  to
          submit  a  job.   If only the at.deny file exists, and it is
          empty, global usage  is  permitted.   The  allow/deny  files
          consist of one user name per line.


     Examples
          The simplest way to use at is to place a series of  commands
          in  a  file,  one  per line, and execute these commands at a
          specified time with the following command:

               at time < file

          The following sequence can be used at a terminal  to  format
          the  file  infile  using  the  text formatter nroff(CT), and
          place the output in the file outfile.

               batch
               nroff infile > outfile
               CTL-d

          The next example demonstrates redirecting standard error  to
          a  pipe (|), which is useful in a shell procedure.  The file
          infile is formatted and the output placed in  outfile,  with
          any   errors   generated   being   mailed  to  user  (output
          redirection is covered on the sh(C) manual page).

               batch <<!
               nroff infile 2>&1 >outfile | mail user
               !

          To have a job reschedule itself, invoke at from  within  the
          job.   For  example,  if  you  want  shellfile  to run every
          Thursday,  executing  a  series   of   commands   and   then
          rescheduling  itself  for the next Thursday, you can include
          code similar to the following within shellfile:

               echo "sh shellfile" | at 1900 thursday next week


     Files
          /usr/lib/cron            main cron directory

          /usr/lib/cron/at.allow   list of allowed users

          /usr/lib/cron/at.deny    list of denied users

          /usr/lib/cron/queuedefs  scheduling information

          /usr/spool/cron/atjobs   spool area


     See Also
          cron(C),   kill(C),   mail(C),   nice(C),   ps(C),    sh(C),
          queuedefs(F)


     Diagnostics
          Complains about syntax errors and times out of range.


     Standards Conformance
          at and batch are conformant with:
          AT&T SVID Issue 2, Select Code 307-127;
          and The X/Open Portability Guide II of January 1987.


     (printed 8/28/89)                                  AT(C)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026