Chapter 24. Automating Jobs

   

Chapter Syllabus

24.1 Introduction to cron

24.2 Automating Jobs Using the crontab Command

24.3 Automating Jobs Using the at Command

Routine system administration tasks should be done on a regular basis. For example, you must clean out temporary files and trim system log files; otherwise , file systems will become full. Similarly, system backup is an important task that is done on a regular basis, as you have studied in Chapter 23. Some of these tasks may take a long time, and it is not practical to carry out these tasks manually. You can also schedule a task that is to be done on a regular basis. An example of this may be the preparation of weekly or monthly reports . Other than these routine tasks that are carried out repeatedly, sometimes you may also need to run commands only once at a specified time. For example, you may need to run a command at 2 a.m., but you may not like to be awakened for this purpose at that time.

Tasks can be scheduled using cron . You can specify a time at which a task must be carried out. At system startup, cron runs as a daemon and is started at run level 2. It reads its configuration files and schedules jobs listed in these files. The cron writes its activities to a log file. The system administrator can configure cron to allow or deny job scheduling for common system users. Selected system users may be granted cron access. Each user who is granted cron access can create his or her own configuration file containing tasks to be scheduled and the time needed for these tasks. HP-UX provides commands that can be used to create, edit, list, or delete the configuration files.

There are two types of jobs that are scheduled using cron : jobs that are executed only once and jobs that are executed repeatedly. If you want to execute a job repeatedly after a specified interval of time, you use the crontab command. If you want to execute a job only once, you use the at command. This chapter will start with an introduction to the cron daemon that schedules all jobs. Then you will learn how to use crontab files to execute jobs repeatedly. Finally, you will use the at command to execute a job only once at a specified time.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net