#* * * * * command to be executed #- - - - - #| | | | | #| | | | +----- day of week (0 - 6) (Sunday=0) #| | | +---------- month (1 - 12) #| | +--------------- day of month (1 - 31) #| +-------------------- hour (0 - 23) #+------------------------- min (0 - 59)
Examples:
To run every minute:
* * * * * /path/to/my/script.sh
To run every x minutes:
*/10 * * * * /path/to/my/script.sh # every 10 minutes
To run every x hours:
# 5 hours and 0 minutes 0 */5 * * * /path/to/my/script.sh # 6 hours and 10 minutes : 10 */6 * * * /path/to/my/script.sh
To run at midnight :
0 0 * * * /path/to/my/script.sh