※Cron  個人排程

vi  /var/spool/cron/帳號(排程檔)

  • crontab  -L      例出個人排程
  • crontab  -e      編輯個人排程
  • crontab  -r      移除個人排程

※系統排程 cron

  *      *    *    *   *      momo          touch /tmp/1.txt

分鐘    小時    天     月    週       執行身份       指令

排程設定檔二選一

  • /etc/crontab      
  • /etc/cron.d/排程檔     

※將執行檔放到指定目錄

  • /etc/hourly      每小時
  • /etc/daily      每天
  • /etc/weekly      每週
  • /etc/monthy      每個月

範例:

*/10  *  *  *   *        每隔十分鐘

30   8,9,10  *  *   *        8點半、9點半、10點半

30    8-10  *  *   *        8點半、9點半、10點半

30   1  *  *   0    /sbin/reboot     每個星期天早上1點30分定時重開機

 

※ at 排程

service  atd restart          啟動at 排程功能

※ at 使用者

  • at  -l                         列出at的排程
  • at  -d  編號              刪除特定編號at
  • at  時間                    設定at 排程

arrow
arrow
    全站熱搜

    奔騰兔 發表在 痞客邦 留言(0) 人氣()