Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

atq(1)

atrm(1)

calendar(1)

credentiald(1)

crontab(1)

date(1)

environ(5)

kill(1)

mail(1)

nice(1)

ps(1)

sh(1)

sort(1)

cron(1M)

getdate(3C)



at(1)                          DG/UX R4.11MU05                         at(1)


NAME
       at, batch - execute commands at a later time

SYNOPSIS
       at [-f script] [-m] time [date] [+ increment]
       at -l [job ...]
       at -r job ...
       batch

   where:
       script    The name of a file containing commands
       time      h, hh, hhmm, h:m, h:mm, hh:m, or hh:mm, where h is hours
                 and m is minutes.  A 24-hour clock is assumed, unless am or
                 pm is appended to time.  If zulu is appended to time, it
                 means Greenwich Mean Time (GMT).  time can also take on the
                 values: noon, midnight, and now.  at now responds with the
                 error message too late; use now with the increment
                 argument, such as at now + 1 minute.
       date      Either a month name followed by a day number (and possibly
                 a year number preceded by a comma) or a day of the week.
                 (Both the month name and the day of the week may be spelled
                 out or abbreviated to three characters.)  Two special
                 ``days'', today and tomorrow are recognized.  The default
                 is today if the given hour is greater than the current
                 hour, tomorrow if it is less.  If the given month is less
                 than the current month (and no year is given), next year is
                 assumed.
       increment A number suffixed by one of the following: minutes, hours,
                 days, weeks, months, or years.  (The singular form is also
                 accepted.)  If next precedes increment, it means `+ 1'.
       job       A job name (e.g. 123456.a)

DESCRIPTION
       At and batch read commands from standard input to be executed at a
       later time.  at allows you to specify when the commands should be
       executed, while jobs queued with batch will execute when system load
       level permits.

       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 priority
       are lost.

       at and batch write the job number and schedule time to standard
       error.  Both commands read from standard input.  sh(1) provides
       different ways of specifying standard input.  Within your commands,
       it may be useful to redirect standard output.

   Options
       -f script Read commands to be executed from the named script file.

       -l [job]  Report all jobs scheduled for the invoking user, or just
                 the jobs specified.

       -m        Send mail to the user after the job has been completed,
                 indicating that the job is finished, even if the job
                 produces no output.  Mail is sent only if the job has not
                 already generated a mail message.

       -q queue  Submit the job in queue queue rather than the default queue
                 a.  The valid queues are a through z. batch submits jobs in
                 queue b. Queue c is reserved for cron(8) and jobs cannot be
                 submitted to that queue.  NOTE: The user must define the
                 queues d through z or else the queue will function without
                 a specified form.

       -r job    Remove specified jobs previously scheduled using at.

   Access Permissions
       Users are permitted to use at if their name appears in the file
       /etc/cron.d/at.allow.  If that file does not exist, the file
       /etc/cron.d/at.deny is checked to determine whether the user should
       be denied access to at.  If neither file exists, only a user with
       appropriate privilege is allowed to submit a job.  If only at.deny
       exists and is empty, global usage is permitted.  The allow/deny files
       consist of one user name per line.  These files can only be modified
       by a privileged user.

   Security Features
       On a system with DG/UX information security, the cron daemon is a
       full-fledged session initiator.  This means that the submitted job
       must be authorized to run at the time for which it is scheduled. This
       determination is made by the cron daemon at run time.  Therefore, it
       is no longer safe to assume that the job will be run simply because
       at or batch accepted the job when invoked by the user (per the access
       restrictions described above).  For a job created by at or batch,
       cron will attempt to create the session via credentiald with a
       service name of "at", the username of the submitting user, and the
       time at which the job is scheduled to run.  On systems with mandatory
       access control (MAC), the label at which the job was submitted is
       also requested for the new session.  If the job turns out not to be
       authorized, cron will send mail to the user reporting this.  The
       credentials of the job when it runs are determined by merging those
       of the submitting user (saved by at for retrieval by cron) and those
       authorized for the session by credentiald.  This is done in a
       restrictive way (the merge intersects features of the credentials
       which grant privilege (such as capabilities) while unioning those
       which limit privilege (audit mask)).

       On a system with mandatory access control (MAC), the spool area,
       /var/spool/cron/atjobs, is a multilevel directory. Jobs are queued at
       the MAC label of the submitting process and are run at that label.
       Any mail sent to the user is sent at the MAC label at which the job
       was run.

   Date Format
       If the DATEMSK environment variable is set, at uses its value as the
       pathname of a template file containing format strings.  These format
       strings determine the valid time and date values instead of the
       values described above.  The strings consist of field descriptors and
       text characters and provide a richer set of allowable date formats in
       different languages by appropriate settings of the environment
       variable LANG or LC_TIME (see environ(5)).

       For the allowable list of field descriptors, see getdate(3C).  This
       list is a subset of the descriptors allowed by calendar(1) that are
       listed on the date(1) manual page.

       The formats described above for the time and date arguments, the
       special names noon, midnight, now, next, today, tomorrow, and the
       increment argument are not recognized when DATEMSK is set.

   Removing and Listing Jobs
       at -r removes jobs previously scheduled by at or batch.  The job
       number is the number returned to you previously by the at or batch
       command.  You can also get job numbers by typing at -l.  You can
       remove only your own jobs unless you are a privileged user.

EXAMPLES
       Valid commands include:

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

       This sequence can be used at a terminal:

              batch
              sort filename > outfile
              Ctrl-D (hold down CTRL and press `d')

       This sequence, which shows redirecting standard error to a pipe, is
       useful in a shell procedure (the sequence of output redirection
       specifications is significant):

              batch <<!
              sort filename 2>&1 > outfile | mail loginid
              !

       To have a job reschedule itself, invoke at from within the shell
       procedure, by including code similar to the following within the
       shell file:

              echo "sh shellfile" | at 1900 thursday next week

       The following example shows the possible contents of a template file
       AT.TEMPL in /etc/cron.d.

              %I %p, the %est of %B of the year %Y run the following job
              %I %p, the %end of %B of the year %Y run the following job
              %I %p, the %erd of %B of the year %Y run the following job
              %I %p, the %eth of %B of the year %Y run the following job
              %d/%m/%y
              %H:%M:%S
              %I:%M%p

       The following are examples of valid invocations if the environment
       variable DATEMSK is set to /etc/cron.d/AT.TEMPL.

          at 2 PM, the 3rd of July of the year 2000 run the following job
          at 3/4/99
          at 10:30:30
          at 2:30PM

FILES
       /etc/cron.d             main cron directory
       /etc/cron.d/at.allow    list of allowed users
       /etc/cron.d/at.deny     list of denied users
       /etc/cron.d/queuedefs   scheduling information
       /var/spool/cron/atjobs  spool area

DIAGNOSTICS
       at can detect syntax errors and times out of range.

SEE ALSO
       atq(1), atrm(1), calendar(1), credentiald(1), crontab(1), date(1),
       environ(5), kill(1), mail(1), nice(1), ps(1), sh(1), sort(1).
       cron(1M).
       getdate(3C).


Licensed material--property of copyright holder(s)

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