Sunday, February 12, 2006

Using @reboot @monthly @weekly.... in CRON

The following keywords are available, which can be substituted for the normal five field used under cron
    String         What it means

@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".

@reboot can be used a start a program on reboot.
Another possible use, could be to trigger a email notification/alert whenever a reboot is taken on
the given machine.

No comments: