[systemd-devel] systemd boot timer problem

Wol antlists at youngman.org.uk
Sat Nov 27 02:15:52 UTC 2021


The problem is easy to explain, but I can't solve it. Basically, I want 
to run a .service every nth boot as part of the boot process.

They always say "state what you're trying to achieve, not how you're 
trying to achieve it", so ...

I have a desktop/server which is rebooted pretty much every day. I want 
to take a snapshot of / every Saturday, which I need to do before it is 
mounted rw so I know it's clean (I'll then do a weekly system update, an 
emerge).

So basically what I'm trying to do is make my .timer ENABLE my service 
every Friday, but as far as I can tell it RUNS it instead. I don't think 
the timer service runs early enough in the boot process to enable it so 
it runs before root is mounted and can enable it in time.

And the RunOnce doesn't seem to be any help because it looks to me like 
that runs once per boot ...

So how do I configure a boot-time service to only run "occasionally" on 
my schedule?

Cheers,
Wol


More information about the systemd-devel mailing list