( 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.定时器(5)如何将计时器与其他计时器关联起来。只能用单位来完成systemd
吗?