他のタイマーに基づいて怠惰なタイマーを予約する方法はありますか?

他のタイマーに基づいて怠惰なタイマーを予約する方法はありますか?

( x-mas.service)

[Unit]
Description=Celebrate X-Mas

[Service]
Type=simple
ExecStart=/usr/sbin/x-mas-day

[Install]
WantedBy=multi-user.target

( x-mas.timer)

[Unit]
Description=Add "X-Mas" to the calendar

[Timer]
OnCalendar=*-12-25 00:00:00
Unit=x-mas.service

[Install]
WantedBy=timers.target

( buy-presents.service)

[Unit]
Description=Get your wallet out
Requires=x-mas.service
Before=x-mas.service

[Service]
Type=simple
ExecStart=open-amazon-dot-com.sh

[Install]
WantedBy=multi-user.target

( buy-presents.timer)

[Unit]
Description=Buy presents
Before=x-mas.timer
Requires=x-mas.timer

[Timer]
OnActiveSec=1
AccuracySec=no-pressure?
RandomizedDelaySec=true?

[Install]
#WantedBy=timers.target
RequiredBy=x-mas.timer

きっと今日まではまだ時間が多いプレゼントを買うしたがって、「クリスマスの締め切り」を前に最適化するには、スケジュールの柔軟性が必要ですが、最初に読んだときは明確ではありませんでした。systemd.timer(5)タイマーを他のタイマーと接続する方法。単位でのみ可能ですsystemdか?

ベストアンサー1

私は徐々に理解し始めた。システムユニット(5)Before=およびオプションはレベル設定Requires=のみを参照し、[Unit]レベルの設定とは関係ありません[Timer]。入力に加えてシステム時間(7)- シェルの助けを借りずに実行できない値の設定を[Timer]デバイスに合わせます。

おすすめ記事