Scheduling a process for later operation

You can set up a process as a batch process to run in the background at a scheduled time.

The at and smit commands let you enter the names of commands to be run at a later time and allow you to specify when the commands should be run.

Note: The /var/adm/cron/at.allow and /var/adm/cron/at.deny files control whether you can use the at command. A person with root user authority can create, edit, or delete these files. Entries in these files are user login names with one name to a line. The following is an example of an at.allow file:

If the at.allow file exists, only users whose login names are listed in it can use the at command. A system administrator can explicitly stop a user from using the at command by listing the user's login name, in the at.deny file. If only the at.deny file exists, any user whose name does not appear in the file can use the at command.

You cannot use the at command if any one of the following is true:
  • The at.allow file and the at.deny file do not exist (allows root user only).
  • The at.allow file exists but the user's login name is not listed in it.
  • The at.deny file exists and the user's login name is listed in it.

If the at.allow file does not exist and the at.deny file does not exist or is empty, only someone with root user authority can submit a job with the at command.

The at command syntax allows you to specify a date string, a time and day string, or an increment string for when you want the process to run. It also allows you to specify which shell or queue to use. The following examples show some typical uses of the command.

For example, if your login name is joyce and you have a script named WorkReport that you want to run at midnight, do the following:

  1. Type the time you want the program to start running:
    at midnight
  2. Type the names of the programs to run, pressing Enter after each name. After typing the surname, press the end-of-file character (Ctrl-D) to signal the end of the list.
    After you press Ctrl-D, the system displays information similar to the following:
    job joyce.741502800.a at Fri Jul  6 00:00:00 CDT 2002.
    The program WorkReport is given the job number joyce.741502800.a and will run at midnight, July 6.
  3. To list the programs you have sent to be run later, type the following:
    at -l
    The system displays information similar to the following:
    joyce.741502800.a       Fri Jul  6 00:00:00 CDT 2002

See the at command for the complete syntax.