             
                                                     
                                                       
               ۰߰     ܰ۰  
             ۱      ܱ߰    ۰
             ۱          ۱      ۰  
                 ܰ߱    ߰۲    
              Outbreak Magazine Issue #14 - Article 10 of 15
          '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

Alot of people I have talked to who were new to *nix thought that cron was
to complicated to understand. Hopefully I will be able to explain it so
that people can understand it.
                                                               
Okay I'll start of by explaining the crontabs. As root do

#: crontab -u user -e

where user is the users crontab you wish to edit. It will open up the
crontab file for that user in the system wide editor which is defined by
the $EDITOR env variable. If thats not set correctly you'll want to add
that to your bashrc/_profile. The file will probably be blank unless
you've added some crons. Each cron has 6 parts. The first 5 define when to
execute the 6th part, which is a command or script or whatever you want
the cron to execute. Here is a definition of the first 5 parts.

       The time and date fields are:

              field          allowed values
              -----          --------------
              minute         0-59
              hour           0-23
              day of month   1-31
              month          1-12 (or names, see below)
              day of week    0-7 (0 or 7 is Sun, or use names)

The first part is the minute. Cron checks to see if it should execute each
cron every minute. You can have each of the first 5 be either a * or a
list. A list would look like this "0,6,12,18". If the minute is a * then the
cron will be executed every minute that matches the rest of the cron. So
if you had a cron of "* 3 * * *" it would execute once per minute from 3 am
to 4 am. However if it was "0 3 * * *" it would execute once at 3 am. Say
you wanted something to occur every 6 hours. The cron would look like this
"0 0,6,12,18 * * * command". Thats how the lists work. It basically lets you
match more than one amount for minute,day,etc ... You can also specify
amounts by increments, for instance "0 3 * * 1-5" would get executed every
weekday at 3 am. I hope you learned something from this and for more
detailed information ... man 5 crontab. Crons really are a powerful tool.
