Cron
Manually taking care of repetitive tasks is a waste of time. Tasks like backing up system, cleaning logs, checking disk space, and many more, need to be automated. Cron is the most basic tool in Linux that lets you automate such tasks.
Understanding Cron
Cron executes scheduled tasks at specified times. You define the time and the command to be executed in a configuration file called crontab. Each line in the crontab consists of a time and a command.
|
|
The five asterisks represent minute, hour, day, month, and weekday respectively. An asterisk signifies ‘all’. So the above configuration runs the command every minute.
Scheduling Time
You can set up various use cases such as running backups every day at 3 AM, generating business reports on weekdays at 9 AM, or checking server health every 5 minutes.
|
|