Chapter 14. The cron Daemon and crontab

14.1 The at Command

The at command reads from standard input the names of commands to be run at a later time and allows you to specify when the commands should be run. The at command mails you all output from standard output and standard error for the scheduled commands, unless you redirect that output. It also writes the job number and the scheduled time to standard error.

Submit a job to be run at a later time using the format:

at -f filename -t CCYYMMDDhhmmSS Increment

where the values of the -t and -f flags are:

CC
Specifies the first two digits of the year (the century). If this is not specified, the default value is 19 if the value of YY is between 70 and 99. The default value is 20 if the value of YY is between 00 and 37.
YY
Specifies the second two digits of the year.
MM
Specifies the month of the year (01 through 12).
DD
Specifies the day of the month (01 through 31).
hh
Specifies the hour of the day (00 through 23).
mm
Specifies the minute of the hour (00 through 59).
SS
Specifies the second of the minute (00 through 59). The default value is 00 is it is not specified.
filename
Specifies the command file to be run at a later time.
The optional Increment parameter can be one of the following:

Instead of the -t flag, you can also use the following keywords:

Other flags and values can be found in the AIX product documentation.

14.1.1 Location of the Spool Area Directory for the at Command

The spool area directory for the at command is /var/spool/cron/atjobs. After a job is scheduled to run, a file exists in the /var/spool/cron/atjobs directory and the atq command shows:

# ls /var/spool/cron/atjobs
root.915213600.a
# atq
root.915213600.a        Fri Jan  1 12:00:00 CST 1999

After the job is deleted, the /var/spool/cron/atjobs directory is empty and the atq command no longer shows anything:

# at -r root.915213600.a
The root.915213600.a at file is deleted.
# ls /var/spool/cron/atjobs
# atq

14.2 Location of crontab Files