Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

at 指令單次排程教學:時間格式、atd 服務、常用參數、與 crontab 差異、實戰範例

編輯:關於 Linux

at 用於「一次性」定時執行,cron 用於「週期性」。需啟動 atd 服務。

時間格式支援

  • 絕對:HH:MM、HH:MM YYYY-MM-DD、HH:MM am/pm Month Day。
  • 相對:now + 5 minutes、04pm + 3 days、today、tomorrow。
  • 關鍵字:midnight、noon、teatime (16:00)。

常用參數

  • -m:完成寄信通知。
  • -f file:從檔案讀取指令。
  • -l / atq:列出隊列。
  • -d / atrm:刪除任務。
  • -c:顯示任務內容。

操作流程

  1. 啟動 atd:/etc/init.d/atd start,設開機自啟 chkconfig --level 2345 atd on。
  2. 執行 at 04:00,輸入指令,Ctrl+D 結束。
  3. atq 確認,atrm 號碼 刪除。

適合「今晚備份一次」、「明早重啟服務」等一次性需求。

上一頁123下一頁共3頁

Copyright © Windows教程網 All Rights Reserved