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

Linux 排程任務總覽:at 單次排程與 crontab 週期性排程

編輯:Linux 教學
 

Linux 排程任務分為 單次執行 (at) 與 週期性執行 (crontab) 兩大類,分別由 atd 與 crond 服務驅動。

兩類排程比較

特性atcrontab
執行頻率單次循環 (分/時/日/週/月/年)
服務atdcrond
設定方式互動式指令crontab -e 或編輯 /etc/crontab
適用場景臨時備份、指定時間關機、長時間編譯定期更新資料庫、日誌切割、系統維護

系統內建常見排程任務

  • logrotate:定期切割壓縮日誌,避免單一檔案過大影響效能。
  • logwatch:分析日誌郵寄給 root,提示錯誤、安全事件。
  • updatedb:更新 locate 檔案名資料庫。
  • makewhatis:更新 whatis 指令資料庫。
  • RPM 資料庫重建:追蹤軟體安裝變動。
  • tmpwatch:清理過期暫存檔釋放磁碟空間。
  • 網路服務分析:如 Apache 存取日誌分析、憑證到期檢查。

安裝額外服務 (如資料庫、監控代理) 通常會自行加入排程,系統負載隨服務增加而上升。

後續閱讀

Copyright © Windows教程網 All Rights Reserved