Scheduling tasks in Linux can be a lifesaver when you want things done automatically.
hi, i'm a little confused. how does the date.timer start the date.service? just by the same name? e.g. foo.timer is automatically related to foo.service?
Sorry for the late reply 🙂
Yes, by default a systemd timer unit triggers a service unit with the same base name.
For example:
- foo.timer will start foo.service when the timer fires.
This happens automatically unless you explicitly override it with:
[Timer]
Unit=some-other-name.service
So in the common case, you just create:
- foo.service → what should run
- foo.timer → when it should run
and systemd links them by name
Yeh, same doubt?
Thanks for sharing 👍.
You are welcome, I hope you found it useful.
hi, i'm a little confused. how does the date.timer start the date.service? just by the same name? e.g. foo.timer is automatically related to foo.service?
Sorry for the late reply 🙂
Yes, by default a systemd timer unit triggers a service unit with the same base name.
For example:
- foo.timer will start foo.service when the timer fires.
This happens automatically unless you explicitly override it with:
[Timer]
Unit=some-other-name.service
So in the common case, you just create:
- foo.service → what should run
- foo.timer → when it should run
and systemd links them by name
Yeh, same doubt?
Yes, by default a systemd timer unit triggers a service unit with the same base name.
For example:
- foo.timer will start foo.service when the timer fires.
This happens automatically unless you explicitly override it with:
[Timer]
Unit=some-other-name.service
So in the common case, you just create:
- foo.service → what should run
- foo.timer → when it should run
and systemd links them by name
Thanks for sharing 👍.
You are welcome, I hope you found it useful.