Periodic command execution: cron and at
Keywords: sag

Next: Graphical user interface Up: Major services in a Previous: Syslog

## Periodic command execution: `cron` and `at`

Both users and system administrators often need to run commands periodically. For example, the system administrator might want to run a command to clean the directories with temporary files (`/tmp` and `/var/tmp` ) from old files, to keep the disks from filling up, since not all programs clean up after themselves correctly.

The `cron` service is set up to do this. Each user has a `crontab` , where he lists the commands he wants to execute and the times they should be executed. The `cron` daemon takes care of starting the commands when specified.

The `at` service is similar to `cron` , but it is once only: the command is executed at the given time, but it is not repeated.