Examples
Run a command every minute
# run this command every minute of every day to check apache
* * * * * /var/www/devdaily.com/bin/check-apache.sh
Run a crontab command every hour
# hit this url to run the drupal cron process every hour of every day
# this command will run at 12:05, 1:05, etc.
5 * * * * /usr/bin/wget -O - -q -t 1 http://localhost/cron.php
Run a crontab entry every day
# run the backup scripts at 4:30am
30 4 * * * /var/www/devdaily.com/bin/create-all-backups.sh
Run a crontab entry every 5 minutes
1.
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/www/devdaily.com/bin/do-update.sh
2.
# run this crontab entry every 5 minutes
*/5 * * * * /var/www/devdaily.com/bin/do-update.sh
Blurb
Step values can be used in conjunction with ranges. Following a range
with "<number>" specifies skips of the number’s value through the
range.
For example, "0-23/2" can be used in the hours field to specify
command execution every other hour (the alternative in the V7 standard
is "0,2,4,6,8,10,12,14,16,18,20,22").
Steps are also permitted after an asterisk, so if you want to say
"every two hours", just use "*/2".
Last updated
Was this helpful?