10.1. Introduction to Cron Jobs

A Cron job is a UNIX term for a command that is run on a regular schedule by the cron daemon. Each job is owned by a UNIX user, and runs with the permission of that user. Each has a set of minutes, hours, days, months, and days of weeks on which it runs, allowing considerable flexibility in scheduling. For example, a job may run every 10 minutes, or at 3 a.m. every day, or at 5 p.m. Monday to Friday in January, February, and March.

Cron jobs are very useful for performing regular system tasks, such as cleaning up log files, synchronizing the system time, backing up files, and so on. Most Linux distributions will have several Cron jobs that were set up by default as part of the operating system install process for doing things like removing unneeded kernel modules, updating the database used by the locate command, and rotating log files.

The actual Cron job configuration files are stored in different places, depending on whether they are part of a package included in your Linux distribution or created by a user. The /var/spool/cron directory is for jobs created manually by users, and contains one file per UNIX user. The /etc/crontab file and the files under the /etc/cron.d directory contain jobs that are part of packages, such as those that are part of your distribution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.103.210