Sometimes i have poor internet connectivity, and my timer dont trigger, is there a easy way to make it retry if failure , like retry 1hour later ?
By combining OnBootSec=
and OnUnitActiveSec=
, it is possible to define a timer that elapses in regular intervals and activates a specific service each time.
can give a example ?
Try looking at some of the system timers such as /usr/lib/systemd/system/logrotate.timer for examples of how it may be done. Many of the timers in /usr/lib/systemd/system/ are recurring so the examples are plentiful.
OnUnitActiveSec=
can be used to define the interval between repetitions, but another trigger (like OnActiveSec=
or OnBootSec=
) would be needed to trigger the first run of the service to get the ball rolling.