0

I have a systemd template, [email protected] defined as:

[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

I need to run four different instances of this script with different parameters for -d, so I have set up a load.target defined as:

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

[Install]
WantedBy=multi-user.target

I want each of the four instances to run every 10 minutes.

How can I set up a systemd timer to invoke the .target at an interval?

1 Answer 1

0

You can create a timer unit [email protected] defined as:

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

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

And modify load.target to invoke the .timer units instead of the .service units:

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

[Install]
WantedBy=multi-user.target

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .