Running Like Clockwork
When you start working with scripts, you may want to run a script at a preset time, usually at a time when you're not there. The Linux system provides a couple of ways to run a script at a preselected time: the at
command and the cron
table. Each method uses a different technique for scheduling when and how often to run scripts. The following sections describe each of these methods.
Scheduling a job using the at command
The at
command allows you to specify a time when the Linux system will run a script. The at
command submits a job to a queue with directions on when the shell should run the job. The at
daemon, atd
, runs in the background and checks the job queue for jobs to run. Most Linux distributions start this daemon automatically at boot time.
The atd
daemon checks a special directory on the system (usually /var/spool/at
) for jobs submitted using the at
command. By default, the atd
daemon checks this directory every 60 seconds. When a job is present,...