<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body vlink="#551A8B" text="#000000" link="#0B6CDA" bgcolor="#ffffff"
alink="#EE0000">
<p>Why can't you use After= ?</p>
<div class="moz-cite-prefix">On 7/12/24 12:42,
<a class="moz-txt-link-abbreviated" href="mailto:t.schneider@disroot.org">t.schneider@disroot.org</a> wrote:<br>
</div>
<blockquote type="cite"
cite="mid:73da862b5ff600be0c047613d47f2cb1@disroot.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p
style="color: #333333; font-size: 13px; font-family: sans-serif; background-color: #fcfdfe;">Hello,<br
style="font-family: sans-serif !important;">
I have a backup job (using rsnapshot) that must be executed
daily, weekly and monthly.<br
style="font-family: sans-serif !important;">
Therefore I created these systemd-timers:</p>
<div class="codebox"
style="color: #222222; font-size: 13px; font-family: sans-serif;">
<pre class="vscroll"
style="font-size: 1em; font-family: monospace !important; font-weight: normal;"><code
style="font-size: 1em; font-family: monospace !important;"># /etc/systemd/system/rsnapshot-daily.timer
[Unit]
Description=rsnapshot daily backup
[Timer]
OnCalendar=daily
RandomizedDelaySec=10m
Persistent=true
<a class="moz-txt-link-abbreviated" href="mailto:Unit=rsnapshot@daily.service">Unit=rsnapshot@daily.service</a>
[Install]
WantedBy=timers.target
# /etc/systemd/system/rsnapshot-weekly.timer
[Unit]
Description=rsnapshot weekly backup
[Timer]
OnCalendar=weekly
RandomizedDelaySec=10m
Persistent=true
<a class="moz-txt-link-abbreviated" href="mailto:Unit=rsnapshot@weekly.service">Unit=rsnapshot@weekly.service</a>
[Install]
WantedBy=timers.target
# /etc/systemd/system/rsnapshot-monthly.timer
[Unit]
Description=rsnapshot monthly backup
[Timer]
OnCalendar=monthly
RandomizedDelaySec=10m
Persistent=true
<a class="moz-txt-link-abbreviated" href="mailto:Unit=rsnapshot@monthly.service">Unit=rsnapshot@monthly.service</a>
[Install]
WantedBy=timers.target</code></pre>
</div>
<p
style="color: #333333; font-size: 13px; font-family: sans-serif; background-color: #fcfdfe;"> </p>
<p
style="color: #333333; font-size: 13px; font-family: sans-serif; background-color: #fcfdfe;">On
07/01/2024 all 3 jobs have been triggered in parallel.<br
style="font-family: sans-serif !important;">
However, rsnapshot can run only once, and therefore 2 jobs have
failed (rsnapshot creates a lockfile /var/run/rsnapshot.pid).</p>
<p
style="color: #333333; font-size: 13px; font-family: sans-serif; background-color: #fcfdfe;">This
means, one must ensure that these scheduled jobs run
sequentially in this order:<br
style="font-family: sans-serif !important;">
monthly - weekly - daily</p>
<p
style="color: #333333; font-size: 13px; font-family: sans-serif; background-color: #fcfdfe;">Can
you please advise how to modify the relevant systemd-timer
config file to ensure the sequential job execution?</p>
<p
style="color: #333333; font-size: 13px; font-family: sans-serif; background-color: #fcfdfe;">THX</p>
</blockquote>
</body>
</html>