Pages by Andreas B. M. Hofmeier
An-H
email Impressum/Note Privacy
http[s]://www.abmh.de/en/papers/ls/Cron.html

Like to be free? ... then: Fight for Freedom

Cron

From Linux Solutions

Jump to: navigation, search

Cron executes a command at a certain time.

You can use
crontab -e
to tell cron what should be executed when. You get a vi. Every line specifies one time and one command:

Example:

# m     h               dom     mon     dow     command
6       10,14,22        *       *       *       /root/runbackup

The script /root/runbackup is executed by cron an 10:06, 14:06, and 22:06 every day, every month.

Fields:

  • m: minute
  • h: hour
  • dom: day of month
  • mon: month
  • dow: day of week
  • command

Special Expressions:

  • "*" indicates, that it is not specified. It means, that the command is executed e.g. every hour.
  • You can specify more than one value by separating them with ","
  • All lines which begin with "#" are ignored. They are comments.

Pages by Andreas B. M. Hofmeier
An-H
email Impressum/Note Privacy
http[s]://www.abmh.de/en/papers/ls/Cron.html
Creative Commons License
(c) Andreas B. M. Hofmeier
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Germany License