cron: Job Scheduler
The Debian and Red Hat distributions come with several pre-configured cron jobs to help control disk usage. Other distributions may provide similar help. The Debian dh_installcron command will install these jobs. Normally, you should not need to run this command—installing the cron package will take care of it for you.
These jobs, located in the file /etc/crontab, use the run-parts command to call all the scripts in directories /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly. For the most part, these scripts control disk usage, compressing and pruning log files in /var/log and cleaning up after indices from the man(1) command. The package maintainers who created these jobs configured them to run during the night, normally a slow time for other system activity. Some of the scripts generate a lot of disk activity, which can slow other I/O-intensive jobs. If you want them to run at other times, edit /etc/crontab or move the scripts among the directories that contain them.
See the list of references in the sidebar for additional reading on cron. Additionally, the man page for the at facility may prove useful. at provides a one-time job-scheduling facility. If you do not keep your Linux system running 24 hours per day, you may want to review Anacron, which does not depend on specific time events to get its work done.
I have provided a brief introduction to the cron facility, a typical part of Linux and other UNIX operating systems. It will provide a starting point for time-related work you want your Linux system to perform. In brief, if you want to schedule repetitive tasks so as not to type the same commands again and again, use cron.
Webinar: 8 Signs You’re Beyond Cron
On Demand NOW
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.View Now!
|Mumblehard--Let's End Its Five-Year Reign||May 04, 2015|
|An Easy Way to Pay for Journalism, Music and Everything Else We Like||May 04, 2015|
|When Official Debian Support Ends, Who Will Save You?||May 01, 2015|
|May 2015 Issue of Linux Journal: Cool Projects||May 01, 2015|
|May 2015 Video Preview||May 01, 2015|
|Ubuntu Ditches Upstart||Apr 30, 2015|
- When Official Debian Support Ends, Who Will Save You?
- Ubuntu Ditches Upstart
- Video On Demand: 8 Signs You're Beyond Cron
- May 2015 Issue of Linux Journal: Cool Projects
- Picking Out the Nouns
- "No Reboot" Kernel Patching - And Why You Should Care
- DevOps: Better Than the Sum of Its Parts
- Return of the Mac
- Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites