01 / 08
While you are not watching
Every tool from the first eleven chapters was one that runs when you type.
~ $ ./checkup.shType, and it runs. Do not type, and it does not. Obvious enough.
But there is work like this.
every morning at five, clear away the logsevery five minutes, look at the free disk spaceevery Sunday, make a summaryGetting up at five to type it yourself is no good. From here on it is about running without typing.
The arrangement is very simple.
> Hand over one table with a time and a doing on each line
The one you hand it to is called crond. That one is already running.
~ $ ps -o pid,args | grep crond 77 /usr/sbin/crond -fThere it is! Since before you opened a terminal it has been looking at the clock every minute, waiting to see if there is anything to do.
The table you hand it is called a crontab — cron's table.
Three things today.
1. how to write the table (five fields)2. handing it over, looking, clearing (crontab)3. inside cron is another world (environment, output)Give the scripts of chapter 11 a time and they become an arrangement for the first time.