at(1) at(1)NAME at, batch - run commands at a later time SYNOPSIS at time [day] [+ increment] at -l [job-number]... at -r job-number... batch ARGUMENTS + increment Specifies an optional increment that further specifies the time at which to run your job. The increment is a number suffixed by one of the following times: minutes, hours, days, weeks, months, or years. An example of an increment is + 1 month as in at 0815pm + 1 month. The at command also accepts the singular form of each increment. day Specifies an optional day on which the command is to be run. The day can be a month name followed by a day number (for example Jan 29); a month name followed by a day number, a comma, and a year number (for example, Jan 29, 1991); or a day of the week, spelled out or abbreviated to three characters (for example, Tuesday or Tue). If you specify a month that is less than the current month and you do not specify a year, at assumes the next year. Two special days, today and tomorrow, are recognized. If you do not specify a date, at uses today if the specified hour is greater than the current hour or tomorrow if it is less. -l [job-number]... Reports by job number the at and batch jobs that you currently have scheduled. -r job-number Removes the specified job-number, which was previously scheduled by means of at or batch. You can remove only your own jobs unless you are logged in as root. time Specifies the time at which to run your job. You must specify a time argument, which can be one, two, or four digits. The at command interprets a time of one or two digits as specifying an hour of the day and interprets a time of four digits as specifying the hour and the minute. You can also specify the time as two numbers separated by a colon, meaning hour:minute. You can append am or pm to time. Otherwise, at uses a 24-hour January 1992 1
at(1) at(1)clock. You can also append zulu to indicate Greenwich mean time. The at command also recognizes a special time of noon, midnight, now, or next. DESCRIPTION at and batch read commands from the standard input and place them on a queue to be run at a later time by the atrun command, which uses the Bourne shell (/bin/sh) to run the job. The at command allows you to specify when the commands are to be run, while jobs queued with batch are run when system load level permits. When the commands are run, atrun mails to you the standard output and standard error output of the job unless you redirected the output elsewhere. You can use at and batch if your name appears in the file /usr/lib/cron/at.allow. If that file does not exist, at checks the file /usr/lib/cron/at.deny to determine if you should be denied access. If neither file exists, only a user who is logged in as root can submit a job. These files consist of one login ID per line. The at and batch commands read the standard input to get the command to run. To terminate the entry of commands, press CONTROL-D. To indicate success, at and batch write the job number and scheduled time on standard error. When the job is run, it inherits the shell environment variables, current directory, file-creation mask, and file- size limit that were in effect when you entered the at or batch command. The job does not inherit your open file descriptors, traps, or priority. If the system is not running at the scheduled time and is started later, atrun does not run the job. EXAMPLES Here are some valid at commands: at 0815pm Jan 24 at 8:15pm Jan 24 at now + 1 day at 5 pm Friday Use this sequence at a terminal to redirect standard output: batch nroff filename > outfile The following sequence, which demonstrates how to redirect standard error to a pipe, is useful in a shell script. The order of output redirection specifications is significant. 2 January 1992
at(1) at(1)batch <<! nroff filename 2>&1 > outfile | mail login-id ! To have a job reschedule itself, invoke at from within a shell script by including code similar to the following line within the script: echo "sh script" | at 1900 thursday next week STATUS MESSAGES AND VALUES at: you are not authorized to use at. Sorry. Indicates that your name is not in /usr/lib/cron/at.allow or that your name is in /usr/lib/cron/at.deny. at: bad date specification Indicates that the day or time argument is incorrect. warning: commands will be executed using /bin/sh Indicates that the command was successful. FILES /usr/bin/at Executable file /usr/bin/batch Executable file /usr/lib/atrun Executable file, invoked by cron, that runs the jobs in the at and batch queues /usr/lib/cron/at.allow File containing a list of allowed users /usr/lib/cron/at.deny File containing a list of denied users /usr/lib/cron/queuedefs File containing scheduling information /usr/spool/cron/atjobs Directory containing the job queue SEE ALSO crontab(1), kill(1), mail(1), nice(1), ps(1), sh(1) cron(1M) in A/UX System Administrator's Reference January 1992 3