Controlling Access to Cron319The cron daemon checks the /etc/crontab file, the /etc/cron.d/ directory, and the /var/spool/cron/ directory every minute for any changes. If any changes are found, they are loaded intomemory. Thus, the daemon does not need to be restarted if a crontab file is changed.34.1.2. Controlling Access to CronThe /etc/cron.allow and /etc/cron.deny files are used to restrict access to cron. The formatof both access control files is one username on each line. Whitespace is not permitted in either file.The cron daemon (crond) does not have to be restarted if the access control files are modified. Theaccess control files are read each time a user tries to add or delete a cron task.The root user can always use cron, regardless of the usernames listed in the access control files.If the file cron.allow exists, only users listed in it are allowed to use cron, and the cron.deny file isignored.If cron.allow does not exist, users listed in cron.deny are not allowed to use cron.34.1.3. Starting and Stopping the ServiceTo start the cron service, use the command /sbin/service crond start. To stop the service,use the command /sbin/service crond stop. It is recommended that you start the service atboot time. Refer to Chapter 19, Controlling Access to Services for details on starting the cron serviceautomatically at boot time.34.2. At and BatchWhile cron is used to schedule recurring tasks, the at command is used to schedule a one-time taskat a specific time and the batch command is used to schedule a one-time task to be executed whenthe systems load average drops below 0.8.To use at or batch, the at RPM package must be installed, and the atd service must be running.To determine if the package is installed, use the rpm -q at command. To determine if the service isrunning, use the command /sbin/service atd status.34.2.1. Configuring At JobsTo schedule a one-time job at a specific time, type the command at time, where time is the time toexecute the command.The argument time can be one of the following:• HH:MM format — For example, 04:00 specifies 4:00 a.m. If the time is already past, it is executed atthe specified time the next day.• midnight — Specifies 12:00 a.m.• noon — Specifies 12:00 p.m.• teatime — Specifies 4:00 p.m.• month-name day year format — For example, January 15 2002 specifies the 15th day of January inthe year 2002. The year is optional.