Programs Scheduled for a Specific Time

Similarly, the program anacron has its own configuration table: ls −l etcanacron −rw−r−−r−− 1 root root 370 Aug 4 2000 etcanacrontab Obviously Linux has gone deeper in this segment than other UNIX flavors. Whether such a sophisticated cron mechanism is really necessary is another issue. Cron is a scheduler, and all UNIX flavors support this facility. Linux does it in a more complex way — it is also fair to say, in a more powerful way.

13.3 Programs Scheduled for a Specific Time

As we mentioned earlier, the cron daemon also checks for jobs scheduled for execution at a specific time. These jobs are known as at−jobs— the name fully reflects the nature of the job itself. The at utility is available to schedule an at−job for execution; a new at−job can be created using the at utility, and submitted into the special queue also known as the queue a for execution at the specified time. At−jobs do not require a great deal of administration. Users can be restricted in the use of the at utility, i.e., their ability to schedule an at−job can be limited. The usrlibcronat.allow and usrlibcronat.deny files provide this discretion. Users can be explicitly permitted to use at if their names appear in the file usrlibcronat.allow; only those users included in the file are allowed to use the utility. If the file does not exist, the file usrlib cronat.deny is checked for explicitly denied users. If neither file exists, only a process with superuser privileges is allowed to submit a job. If only the at.deny file exists and is empty, global usage is permitted. Both files rely on an entry line with the user name for each of the specified users. What does it look like on a live system? On Solaris 2.6, for example, it looks like this: ls −l usrlibcron lrwxrwxrwx 1 root root 16 May 28 1998 usrlibcron − ....etc Obviously, the directory usrlibcron is the link to the directory etccron.d, so the corresponding at allowdeny files can be reached with either path. On this system, only the at.deny file exists: ls −l etccron.d | grep at −rw−r−−r−− 1 root sys 45 May 28 1998 at.deny The file has the following contents: cat etccron.dat.deny daemon bin smtp nuucp listen nobody noaccess 314 The at−jobs are submitted to the a queue for execution. There are two additional queues reserved for special jobs: the b queue is reserved for batch−jobs, and the c queue is reserved for cron−jobs. New queues can be created, but they must be named by lower−case letters except the already−taken letters a, b, and c. This can be done by using the −q option of the at utility. The queue characteristics are described in the etclibcronqueuedefs file or the etc cron.dqueuedefs file. Each queue is identified by a corresponding entry of the form: q.[njobj][nicen][nwaitw]