You are here

Cron

Cron is a *nix/Linux scheduled task system which has various ways to configure, all of which, can live happily together.

crontab

Personal cron entries are accessed by issuing the crontab command and have no "user" field, as they're per-user crontabs.


# crontab for

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=
HOME=/

# .---------------- minute (0-59)
# | .-------------- hour (0-23)
# | | .------------ day of month (1 - 31)
# | | | .---------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .-------- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * /full/path/and/command_to_be_executed

/etc/crontab and /etc/cron.d/*.cron

Cron treats the files in '''/etc/cron.d''' as extensions to the '''/etc/crontab''' file (they follow the special format of that file, i.e. they include the user field). The intended purpose of this feature is to allow packages that require finer control of their scheduling than the /etc/cron.{daily,weekly,monthly} directories allow to add a crontab file to /etc/cron.d.

This is used for has a "user" field...


# .---------------- minute (0 - 59)
# | .-------------- hour (0 - 23)
# | | .------------ day of month (1 - 31)
# | | | .---------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .-------- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | | .------ '''username to run as''' (it's not a personal crontab)
# | | | | | |
# * * * * * '''''' /full/path/and/command_to_be_executed