You are not logged in.

#1 2017-12-20 09:01:21

r4ptor
Member
Registered: 2012-12-30
Posts: 46

[SOLVED]systemd timer specific time after waking up from suspend

Hi,

I currently set up borg on my notebook to backup my data to a remote fileserver.
Now my problem is, to set up a systemd timer, that does this for me automatically a certain time after waking up/or booting the notebook.
A fixed time is not really practicable in my case, cause sometimes I turn on the notebook at 9AM, sometimes at 7AM and so on.


So is there any possibility to create a systemd timer, that executes my commands either a certain time after cold boot or a certain time after wake up, but only once a day?

Thanks

Last edited by r4ptor (2017-12-20 18:14:39)

Offline

#2 2017-12-20 13:01:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [SOLVED]systemd timer specific time after waking up from suspend

r4ptor wrote:

So is there any possibility to create a systemd timer, that executes my commands either a certain time after cold boot or a certain time after wake up, but only once a day?

Yes.

What do you mean by "a certain time after..."?  Why do you want it delayed?  You could do that in the script itself, or have a sleep command as the first Exec line in the service.  But I suspect you don't really want a specific delay, but rather to wait for the network to be up.  There are proper ways of doing that that don't involve arbitrary delays.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2017-12-20 15:22:35

r4ptor
Member
Registered: 2012-12-30
Posts: 46

Re: [SOLVED]systemd timer specific time after waking up from suspend

Doh, over read the persistent option.
So this means, that if the notebook was suspended or shut off when the timer should have happened, the backup will immediately start when the notebook comes back to live?

Thank you.

Offline

#4 2017-12-20 15:48:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: [SOLVED]systemd timer specific time after waking up from suspend

r4ptor wrote:

if the notebook was suspended or shut off when the timer should have happened, the backup will immediately start when the notebook comes back to live?

Yes.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2017-12-20 18:14:05

r4ptor
Member
Registered: 2012-12-30
Posts: 46

Re: [SOLVED]systemd timer specific time after waking up from suspend

Alright, thank you.

Offline

Board footer

Powered by FluxBB