foo.service
還處於執行狀態,下一時間步到了也不會重複執行 foo.service
,可以避免重複執行造成 process 壘加,導致系統異常
foo.service
,當 09 點 10 分到了,結果 09 點 05 分的 foo.service
還在執行中,foo.timer
判斷 foo.service
還是處於activating
狀態,就不會再啟動 foo.service
foo.service
承接 Linux 的功能,比如限制使用的 CPU 和記憶體等/var/log/messages
systemctl
指令操作時,若沒有加結尾,預設你是指 .service
舉例如下,以下是相同指令*.timer
,*.timer
會去執行和自己同樣名稱的 *.service
。如 foo.timer
時間到會去執行foo.service
/opt/foo.sh
foo.service
和 foo.timer
放底下指定路徑/etc/systemd/system/foo.service
/etc/systemd/system/foo.timer
/etc/systemd/system/foo.service
/etc/systemd/system/foo.timer
foo.service
,確認能成功執行foo.timer
,當設定的每 5 分鐘時間到了,foo.timer
會自動執行 foo.service
foo.timer
執行的狀態 (很重要的功能)