Controlling Access To Cron; Starting And Stopping The Service; At And Batch; Configuring At Jobs - Red Hat ENTERPRISE LINUX 5 - DEPLOYMENT Deployment Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - DEPLOYMENT:
Table of Contents

Advertisement

35.1.2. Controlling Access to Cron

The /etc/cron.allow and /etc/cron.deny files are used to restrict access to cron. The format
of 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. The
access 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 is
ignored.
If cron.allow does not exist, users listed in cron.deny are not allowed to use cron.

35.1.3. Starting and Stopping the Service

To 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 at
Chapter 16, Controlling Access to Services
boot time. Refer to
automatically at boot time.

35.2. At and Batch

While cron is used to schedule recurring tasks, the at command is used to schedule a one-time task
at a specific time and the batch command is used to schedule a one-time task to be executed when
the 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 is
running, use the command /sbin/service atd status.

35.2.1. Configuring At Jobs

To schedule a one-time job at a specific time, type the command at time, where time is the time to
execute 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 at
the 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 in
the year 2002. The year is optional.
• MMDDYY, MM/DD/YY, or MM.DD.YY formats — For example, 011502 for the 15th day of January
in the year 2002.
• now + time — time is in minutes, hours, days, or weeks. For example, now + 5 days specifies that
the command should be executed at the same time five days from now.
Controlling Access to Cron
for details on starting the cron service
507

Advertisement

Table of Contents
loading

Table of Contents