这里给出原文出处,尊重原创。https://www.cnblogs.com/uetucci/p/7762053.html
感觉这篇文章将systemd的timer使用讲得比较清晰,易懂。很快就上手了。
我根据这篇文章,实际动手验证了一把,写了一个用例。
/lib/systemd/system/hello.service
[Unit]
Description=test
[Service]
Type=oneshot
ExecStart=/bin/mkdir /home/jqh/work/jqhhello
/lib/systemd/system/hello.timer
[Unit]
Description=hello
[Timer]
OnBootSec=1min
[Install]
WantedBy=timers.target
保存重启系统后,能够达到预期的效果。