|
Running the Crond Service
|
|
The cron and anacron jobs are both picked by the `crond` service. This section provides information on how to start, stop, and restart the `crond` service, and shows how to configure it to start automatically at boot time.
|
|
Starting and Stopping the Cron Service
|
|
To determine if the service is running, use the following command:
|
|
[command]#systemctl status crond.service#
|
|
To run the `crond` service in the current session, type the following at a shell prompt as `root`:
|
|
[command]#systemctl start crond.service#
|
|
To configure the service to start automatically at boot time, use the following command as `root`:
|
|
[command]#systemctl enable crond.service#
|
|
Stopping the Cron Service
|
|
To stop the `crond` service in the current session, type the following at a shell prompt as `root`:
|
|
[command]#systemctl stop crond.service#
|
|
To prevent the service from starting automatically at boot time, use the following command as `root`:
|
|
[command]#systemctl disable crond.service#
|
|
Restarting the Cron Service
|
|
To restart the `crond` service, type the following at a shell prompt as `root`:
|
|
[command]#systemctl restart crond.service#
|
|
This command stops the service and starts it again in quick succession.
|
|
Configuring Anacron Jobs
|
|
indexterm:[anacron,anacron configuration file]indexterm:[anacrontab]indexterm:[anacron,user-defined tasks]indexterm:[/var/spool/anacron] The main configuration file to schedule jobs is the `/etc/anacrontab` file, which can be only accessed by the `root` user. The file contains the following:
|