호출 템플릿의 대상에 대한 시스템 타이머

호출 템플릿의 대상에 대한 시스템 타이머

다음과 같이 정의된 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

관련 정보