On Sat, Aug 22 2015, Marc Joliet wrote:

> Am Sat, 22 Aug 2015 17:15:38 -0400
> schrieb Fernando Rodriguez <frodriguez.develo...@outlook.com>:
>
>> On Saturday, August 22, 2015 4:52:47 PM allan gottlieb wrote:
>> > I use systemd and wish to employ timers an analogue of cron.daily.  The 
>> system is a laptop that is normally turned off each evening.
>> > 
>> > As I read the manuals one can have either a monotone or a realtime timer.  
>> But I seem to need features of each.
>> > 
>> > Specifically, I would like the daily timer to trigger 10 minutes
>> > (say) after
>> boot (OnBootSec=600) but not more than once a day (OnCalendar=daily).
>> > The manual and several wiki pages suggest that you can't mix monotone and 
>> realtime options.
>> > 
>> > Am I misreading the manual (and mixing is permitted) or is there a way to 
>> achieve my goals with just monotone or just realtime options.
>> 
>> I think so, this is what systemd.timer(5) says:
>> 
>> Multiple directives may be combined of the same and of different types. For 
>> example, by
>> combining OnBootSec= and OnUnitActiveSec=, it is possible to define a timer 
>> that elapses in
>> regular intervals and activates a specific service each time.
>> 
>> There's also sys-process/systemd-cron that works like a regular cron
>> and seems
>> to work fine for me but I haven't tested it depth.
>
> Right, I have one timer that, for example, uses:
>
> [Timer]
> OnBootSec=10m
> OnUnitInactiveSec=1h

Those are both monotone options so definitely can be combined.
I want daily so would have

[Timer]
OnBootSec=10 minutes
OnUnitInactiveSec=1d

However If I boot the machine at 9am, turn it off at 10am,
and boot again at 11am, won't the timer fire twice?  I thought for
monotone timers the time starts anew a the next boot?

thanks,
allan

Reply via email to