If you’ve ever tried writing systemd timers by hand, you know: it’s not exactly fun. Between .service and .timer files, path syntax, and OnCalendar expressions, it’s easy to get lost. That’s why I built a small tool: systemd-timer.
What does it do?
It’s simple: You call a CLI command, provide a few arguments, and the tool writes the appropriate .service and .timer files for you — with logging, dependencies, and all the systemd details you’d otherwise have to remember. No copy-pasting templates, no typos, no wondering whether it’s WantedBy=timers.target or not.
Why not just use cron?
Sure, cron works. But systemd has some clear advantages:
- Better logging (including to file)
- Easier integration with other services (like waiting for network)
- Works per-user (no root needed)
- Everything stays in one ecosystem: systemd
This CLI lowers the entry barrier while still encouraging “proper” systemd usage.
What can systemd-timer do?
Generates
.service+.timerunit filesSupports
--usertimers (great for desktop or containers)Logging to file via
--logfileStandard options like:
--exec,--calendar,--after,--environment--description,--output,--dry-run
CLI built with Cliffy, typed with Deno
Platform-independent install via shell script
A quick example
| |
This creates:
~/.config/systemd/user/backup.service~/.config/systemd/user/backup.timer
To activate:
| |
One-liner install
| |
The script auto-detects your architecture (amd64/arm64), fetches the right binary, and verifies it via SHA256. And yes, you can inspect the code before piping it into your shell.
Development & testing
The tool is written entirely in TypeScript with Deno, strictly typed and covered by tests. The core is modular enough that you could use it as a library if needed.
Run tests with:
| |
Conclusion
systemd-timer isn’t a monster with 1000 options — it’s just what you want when you need a clean way to run small systemd-timed tasks without rewriting the same files over and over. It’s aimed at people who prefer declarative setups over improvisation.
Source code, releases, and more: 👉 git.0xmax42.io/maxp/systemd-timer
