我正在测试一个 systemd 计时器并尝试覆盖其默认超时,但没有成功。我想知道是否有办法让 systemd 告诉我们接下来要运行该服务的时间。
普通文件 ( /lib/systemd/system/snapbackend.timer
):
# Documentation available at:
# https://www.freedesktop.org/software/systemd/man/systemd.timer.html
[Unit]
Description=Run the snapbackend service once every 5 minutes.
[Timer]
# You must have an OnBootSec (or OnStartupSec) otherwise it does not auto-start
OnBootSec=5min
OnUnitActiveSec=5min
# The default accuracy is 1 minute. I'm not too sure that either way
# will affect us. I am thinking that since our computers will be
# permanently running, it probably won't be that inaccurate anyway.
# See also: …
Run Code Online (Sandbox Code Playgroud)