關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 實用 crontab 寫法

    Posted on April 20th, 2008 Sam Tang 1 comment

    本站另一篇文章 Unix Crontab 簡介 介紹了 Crontab 的用法,今天發現了一個實用的寫法:

    @daily /usr/local/www/awstats/cgi-bin/awstats.sh

    以上用 @daily 語法,便會在每天零時零分執行,以下是其他用法:

    @reboot: 在每次開機時執行。
    @yearly: 等同 0 0 1 1 * 寫法,即每年一月一日零時零分。
    @annually: 與 @yearly 相同。
    @monthly: 在每月一號零時零分執行。
    @weekly: 在星期天零時零分執行。 Run once a week, “0 0 * * 0″.
    @daily: 每天零時零分。
    @midnight: 與 @daily 相同。
    @hourly: 每小時零分執行。


     

    One response to “實用 crontab 寫法”

    1. Clear and concise
      Thx

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word