6 Comments
User's avatar
snow's avatar

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?

Expand full comment
TRÄW🤟's avatar

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

Expand full comment
K Siva Suriya Prakash's avatar

Yeh, same doubt?

Expand full comment
TRÄW🤟's avatar

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

Expand full comment
K Siva Suriya Prakash's avatar

Thanks for sharing 👍.

Expand full comment
TRÄW🤟's avatar

You are welcome, I hope you found it useful.

Expand full comment