Systemd timer unit
I try to create a timer unit for weekly and daily backups. For example with the weekly unit, it should be executed once in a week, some minutes after login. If the unit was successful, it should shutdown and not start again until the next week. If a start of this unit was missing, it should be start again some minutes after the next login.
But for some unknown reason, the current unit starts after every login when I reboot the laptop. I am relatively sure that this timer unit is set up wrong, but unfortunately I don’t know how I can implement such a unit better with the functions mentioned above.
<span style="color:#323232;">[Unit]
</span><span style="color:#323232;">Description=Run backup weekly
</span><span style="color:#323232;">Requires=backup.service
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Timer]
</span><span style="color:#323232;">Unit=backup.service
</span><span style="color:#323232;">OnCalendar=weekly
</span><span style="color:#323232;">RandomizedDelaySec=120
</span><span style="color:#323232;">Persistent=true
</span><span style="color:#323232;">
</span><span style="color:#323232;">[Install]
</span><span style="color:#323232;">WantedBy=timers.target
</span>
Add comment