crontab examples


# run this command every minute of every day to check apache
* * * * * /var/www/devdaily.com/bin/check-apache.sh

# this command will run at 12:05, 1:05, etc.
5 * * * * /usr/bin/wget -O - -q -t 1 http://localhost/cron.php

# run the backup scripts at 4:30am
30 4 * * * /var/www/devdaily.com/bin/create-all-backups.sh


// every 5 minutes
0,5,10,15,20,25,30,35,40,45,50,55  * * * * /var/www/devdaily.com/bin/do-update.sh

# run this crontab entry every 5 minutes
*/5 * * * * /var/www/devdaily.com/bin/do-update.sh

  string   meaning
  ------   -------
  @reboot   Run once, at startup.
  @yearly   Run once a year, "0 0 1 1 *".
  @annually   (sames 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 * * * *".

min    hour    mday   month   wday   Execution time
30       0           1           1,6,12      *           00:30 Hrs on 1st of Jan, June & Dec.
0         20        *           10         1-5           8.00 PM every weekday (Mon-Fri) only in Oct.
0         0          1,10       *              *            midnight on 1st & 10th  of month
5,10    0          10          *             1             At 12.05,12.10 every Monday & on 10th of every month

No comments: