呼び出しテンプレートの宛先のシステムタイマー

呼び出しテンプレートの宛先のシステムタイマー

次のように定義されたsystemdテンプレートがあります[email protected]

[Unit]
Description=load script
Wants=network-online.target
After=network-online.target
PartOf=load.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 load -d %i
User=root

[Install]
WantedBy=default.target

このスクリプトの4つの異なるパラメータインスタンスを実行する必要があるため、-d定義をload.target次のように設定しました。

[Unit]
Description=dataloader.load workers
[email protected] [email protected] [email protected] [email protected]

[Install]
WantedBy=multi-user.target

この4つのインスタンスを10分ごとに実行したいと思います。

.target特定の間隔で呼び出されるようにシステムタイマーを設定するには?

ベストアンサー1

次のように定義されたタイマーユニットを作成できます[email protected]

[Unit]
Description=Run [email protected] every 10 minutes

[Timer]
OnCalendar=*:0/10
AccuracySec=1us

ユニットの代わりにユニットをload.target呼び出すように修正されました。.timer.service

[Unit]
Description=dataloader.load workers
[email protected] [email protected] [email protected] [email protected]

[Install]
WantedBy=multi-user.target

おすすめ記事