logoalt Hacker News

tpmoneylast Tuesday at 7:37 PM1 replyview on HN

Systemd lets you create templates that take an argument in from the scheduled service. It gets that from the value after the @. So you can write a unit file that schedules a task to run say every 3 days and in that unit file reference `jobs/%i`, then put your task in a file in jobs and say `systemctl start [email protected]` to run `script1.sh` on your schedule without needing to create a new unit file for each script. StepCA has a nice write up on their site about using these templates to schedule cert renewals for any arbitrary service


Replies

Fire-Dragon-DoLyesterday at 2:35 AM

Oh cool, thank you