Re: Antw: [EXT] Re: Q: Start a unit n minutes after a successful boot

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

 



On Di, 08.09.20 11:01, Ulrich Windl (Ulrich.Windl@xxxxxxxxxxxxxxxxxxxx) wrote:

> >> Configuring a new system with non‑redundant system disk I'm wondering:
> >> How could I start an automatic backup job that is triggered n minutes
> >> after the system started successfully (to avoid backing up broken
> >> configurations)?
> >
> >   Timer with "OnBootSec=n minutes" is exactly what you want, right?
>
> Hi!
>
> Is every boot a successful boot? Will (e.g.) default.target be reached even if
> some service failed? If not, that is what I had in mind:
> Start a unit n minutes after default.target was reached
> "sucessfully".

Define a timer unit like this if you want to make this dependent on
"default.target" having been reached.

    [Unit]
    Requisite=default.target
    After=default.target

    [Timer]
    OnActiveSec=2min

    [Install]
    WantedBy=timers.target

This will enqueue the timer during early boot, but not actually
activate it until default.target has been reached. Then once active,
after 2mn the associated service is triggered.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




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

  Powered by Linux