[systemd-devel] systemd.timer every X days?

Mantas Mikulėnas grawity at gmail.com
Tue Jul 28 16:07:00 UTC 2020


I'd create a single raidcheck.service that runs daily and calls a script
that itself determines which device to check, e.g. /dev/md$[dayofyear % 16].

On Sun, Jul 26, 2020, 22:56 Ian Pilcher <arequipeno at gmail.com> wrote:

> My NAS has 16 MD RAID devices.  I've created a simple service
> (raidcheck at .service) that will trigger a check of the RAID device
> identified by the argument.  E.g., 'systemctl start raidcheck at md1' will
> trigger the check of md1 (after checking that no other array is being
> checked/synced, no arrays are degraded, etc.).
>
> It takes 6-8 hours to check one of these arrays, so I want to run one
> check every night at 23:00.  So (picking tonight as an arbitrary
> starting point) md1 would run tonight, md2 would run tomorrow night, md3
> would run the following night ... all the way through md16.  Then the
> cycle would start over with md1.
>
> I had thought that I would be able to create 16 separate timers (one for
> each device), each scheduled to trigger every 16 days at 23:00, starting
> on a particular day.
>
> Looking through the systemd.timer(5) and systemd.time(7) man pages,
> however, I haven't been able to figure out how to do this.  Is it not
> possible, or am I missing something?
>
> --
> ========================================================================
>                   In Soviet Russia, Google searches you!
> ========================================================================
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200728/e2df98db/attachment-0001.htm>


More information about the systemd-devel mailing list