crontab周期任務

來源:互聯網
上載者:User

標籤:使用者

           crontab用法:

                  crontab [-u user] file

                  crontab [-u user] {-l|-r|-e}

                        -l:顯示crontab檔案內容。

                        -e:利用vim編輯使用者crontab檔案。

                        -i:刪除使用者crontab檔案前確認提示。

                        -r:從crontab目錄中刪除使用者crontab檔案。

                            (crontab -ri )

                        -u user:指定使用者。



           /etc/cron.deny:該檔案內的使用者不允許使用crontab命令。

           /etc/cron.allow:該檔案內的使用者允許使用crontab命令。

           /var/spool/cron:所有使用者crontab檔案存放的目錄,以使用者命名。





          crontab檔案的格式:

            *      *      *      *      *      root      run-parts/etc/cron.hourly

            分     時     日     月     周(0表示星期日)

            使用者可以省略

             符號表示:*   任意時間

                       -    時間範圍(2-7點)

                       ,   分割時段(3,6  3點和6點)

                       /n    每隔n單位時間(*/10 表示每十分鐘 相當於0-59/10)



           crontab依賴的服務:chkconfig --list | grep 3:on

                               /etc/init.d/crond status(檢查服務狀態)

crontab周期任務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.