Re: Scheduling 3 periodic jobs using systemd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It might make more sense to create three services. Otherwise you can add overrides for some of them (e.g. /etc/.../rsnapshot@weekly.service) with only a [Unit] section containing a Before=/After= declaration 

On Mon, Jul 15, 2024, 14:52 <t.schneider@xxxxxxxxxxx> wrote:

Actually there's no dedicated *.service file for each period, but only 1 service file:

# cat /etc/systemd/system/rsnapshot@.service
[Unit]
Description=rsnapshot (%I) backup
Requires=backup.mount
After=backup.mount

[Service]
Type=oneshot
Nice=19
IOSchedulingClass=idle
ExecStart=/usr/bin/rsnapshot %I


Am 2024-07-12 18:59, schrieb Nils Kattenbeck:

The After/Before need to be set in the .service files, not the .timer files

On Fri, Jul 12, 2024, 13:26 <t.schneider@xxxxxxxxxxx> wrote:

Actually this was my idea, too.

However, could you precise what to enter in which file?

I was tanding to relevant *.timer files.


Am 2024-07-12 12:43, schrieb Nils Kattenbeck:

If you set proper After/Before dependencies, the units scheduled later should wait for the earlier units to finish

On Fri, Jul 12, 2024, 11:10 <t.schneider@xxxxxxxxxxx> wrote:

Setting the time of day requires detailed knowledge about the runtime of each job.

But this forecast is not accurate and this means any setting could result in same error.


Am 2024-07-12 09:29, schrieb Barry:



On 12 Jul 2024, at 08:19, t.schneider@xxxxxxxxxxx wrote:

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

Maybe you can set the time of day so that you get the sequencing.
Monthly at 01:00, weekly at 03:00 etc

Or you could encode these rules in the script that you run daily.

Barry

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux