Personal tools

Crontab

From MohidWiki

Revision as of 11:27, 3 December 2008 by Guillaume (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Crontab is the tool to schedule tasks in linux

>crontab -e

Example:

0	4	12	3	*	aplication &

The above example tells to execute the application "aplication" the 12/3 at 04:00. The ending ampersand (&) is to wikipedia:fork fork the application in an external shell.

Disable email

Add this at the end of the cronjob line:

>/dev/null 2>&1

First friday of every month

This one's a bit more complicated but it's manageable:

30 13 1-7 * * [ `date +\%w` -eq 5 ]&& myscript.sh >/dev/null 2>&1

External References