Why can't you use After= ?

On 7/12/24 12:42, t.schnei...@disroot.org wrote:

Hello,
I have a backup job (using rsnapshot) that must be executed daily, weekly and monthly.
Therefore I created these systemd-timers:

|# /etc/systemd/system/rsnapshot-daily.timer [Unit] Description=rsnapshot daily backup [Timer] OnCalendar=daily RandomizedDelaySec=10m Persistent=true Unit=rsnapshot@daily.service [Install] WantedBy=timers.target # /etc/systemd/system/rsnapshot-weekly.timer [Unit] Description=rsnapshot weekly backup [Timer] OnCalendar=weekly RandomizedDelaySec=10m Persistent=true Unit=rsnapshot@weekly.service [Install] WantedBy=timers.target # /etc/systemd/system/rsnapshot-monthly.timer [Unit] Description=rsnapshot monthly backup [Timer] OnCalendar=monthly RandomizedDelaySec=10m Persistent=true Unit=rsnapshot@monthly.service [Install] WantedBy=timers.target|

On 07/01/2024 all 3 jobs have been triggered in parallel.
However, rsnapshot can run only once, and therefore 2 jobs have failed (rsnapshot creates a lockfile /var/run/rsnapshot.pid).

This means, one must ensure that these scheduled jobs run sequentially in this order:
monthly - weekly - daily

Can you please advise how to modify the relevant systemd-timer config file to ensure the sequential job execution?

THX

Attachment: OpenPGP_0x20257A7131FFF28B.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to