Skip to content

systemd

タイマーを利用する

systemdのサービスは.timerファイルを用意するスケジュール実行が可能。

例えば以下のようなサービスがあったと

my-service.service
[Unit]
Description=My Service

[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c 'echo "My service running..."'

[Install]
WantsBy=mul