at(1) — Commands
OSF
NAME
at, batch − Runs commands at a later time
SYNOPSIS
at [-cskm] time [date] [+increment] [command | file] ...
at -l [user]
at [-fi] -r job_number ... [-u user] [command | file] ...
at -n [user]
batch
The at and batch commands read from standard input or accept as arguments the names of commands to be run at a later time. The at command allows you to specify when the commands are to be run. The batch command runs jobs when the system load level permits.
FLAGS
-cRequests that csh be used for executing this job.
-fSuppresses delete verification.
-iSpecifies interactive delete.
-kRequests that ksh be used for executing this job.
-l [user]Reports your scheduled jobs. If the root user issues the command with this flag, all of the queued at commands are listed with the name of the user who issued each one. The root user can also request a report of scheduled jobs for the specified user only.
-mMails a message about the successful execution of the command.
-n [user]Requests the number of files in the queue for the current user. The root user can specify a different user with the user argument.
-oLists jobs in scheduled order.
-r job_number ...
Removes a job previously scheduled by at or batch, where job_number is the number assigned by at or batch. If you do not have root user authority, you can remove only your own jobs. The atrm command is available to the root user to remove jobs issued by other users or all jobs issued by a specific user. This flag can be used in combination with the -i, -f, and -u flags.
-sRequests that the Bourne shell be used for executing this job (default).
-u userDeletes all jobs for the specified user. This flag must be used with the -r flag as follows:
at -r -u user
DESCRIPTION
Both at and batch mail you the standard output and standard error from the scheduled commands, unless you redirect that output. They also write the job number and the scheduled time to standard error.
If a filename specified on an at command line is executable (that is, has the x permission for the user in question), at assumes that it is a command and the job consists of this command only. If the file is not executable, at assumes that you want its contents to be the instructions for the job (same as BSD at). If at cannot find the file at all, the specification is passed to the date parser. If the specification is not recognized by the date parser, the user receives the error unknown word.
Variables in the shell environment, the current directory, umask, and ulimit are retained when the commands are run. Open file descriptors, traps, and priority are lost.
You can use at if your name appears in the /var/adm/cron/at.allow file. If that file does not exist, at checks the /var/adm/cron/at.deny file to determine if you are denied access to at. The allow/deny files contain one username per line.
If neither file exists, only someone with root user authority can submit a job. If the at.allow file does exist, the root user’s login name must be included in it for that person to be able to use the command.
The required time argument can be one of the following:
1.A number followed by an optional suffix. at interprets 1- and 2-digit numbers as hours. It interprets four digits as hours and minutes. The LC_TIME environment variable specifies the order of hours and minutes. The default order is the hour followed by the minute. You can also separate hours and minutes with a : (colon). The default order is hour:minute. In addition, you can specify a suffix of am, pm, or zulu. If you do not specify am or pm, at uses a 24-hour clock. The suffix zulu indicates that the time is CUT (Coordinated Universal Time).
2.The at command also recognizes the following keywords as special times: noon, midnight, now, A for a.m., P for p.m., N for noon, and M for midnight. Note that you can use the special word now only if you also specify a date or an increment. Otherwise, at tells you: too late. The LC_TIME environment variable controls the additional keywords that at recognizes.
You can specify the date argument as either a month name and a day number (and possibly a year number preceded by a comma), or a day of the week. The LC_TIME environment variable specifies the order of the month name and day number (by default, month followed by day). at recognizes two special days, today and tomorrow by default. today is the default date if the specified time is later than the current hour; tomorrow is the default if the time is earlier than the current hour. If the specified month is less than the current month (and a year is not given), next year is the default year. The optional increment can be one of the following:
•A + (plus sign) followed by a number and one of the following words: minute[s], hour[s], day[s], week[s], month[s], year[s] (or their non-English equivalents).
•The special word next followed by one of the following words: minute[s], hour[s], day[s], week[s], month[s], year[s] (or their non-English equivalents).
Job numbers are specified as follows:
user.xxxxxxxxx.y
The user argument identifies the user who scheduled the job. xxxxxxxxx is a 9-digit number (encoded time for the job). y indicates the job type as follows:
ArgumentJob Type
aat job
batchbatch job
eksh job
fcsh job
EXAMPLES
1.To schedule a command from a terminal, enter a command similar to one of the following:
at 5 pm Friday uuclean
at now next week uuclean
at now + 2 days uuclean
Note that the preceding commands can be scheduled as shown only if uuclean is in the current directory.
2.To run uuclean at 3:00 in the afternoon on January 24, enter any one of the following commands:
echo uuclean | at 3:00 pm January 24
echo uuclean | at 3pm Jan 24
echo uuclean | at 1500 jan 24
3.To list the jobs you have sent to be run later, enter:
at -l
4.To cancel jobs, enter:
at -r julie.586748399.a
This cancels job julie.586748399. Use at -l to list the job numbers assigned to your jobs.
5.To execute a command when the system load level permits, enter:
batch
nroff infile > outfile
<Ctrl-d>
where <Ctrl-d> is the End-of-File character.
FILES
/var/adm/cronMain cron directory.
/var/adm/cron/at.allowList of allowed users.
/var/adm/cron/at.denyList of denied users.
/var/spool/cron/atjobsSpool area.
RELATED INFORMATION
Commands: atq(1), atrm(1), cron(8), kill(1), mail(1)/binmail(1), mailx(1)/Mail(1), nice(1), ps(1), sh(1).
Guide to System Administration
OSF/1 User’s Guide.