Hacker News new | ask | show | jobs
by LaSombra 23 days ago
If you want to create a new systemd unit file you can run:

   $ sudo systemctl edit --force --full my-scheduled-work@.timer
or

   $ systemctl edit --user --force --full my-scheduled-work@.timer
1 comments

Why the @?
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 every-3-days@script1.sh` 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
Oh cool, thank you