How to create a timer that will only run once?

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

 



There's a popular usecase of human-readably scheduling a command for
later¹. There are multiple non-systemd solutions, but they generally
involve running a 3rd party service, such as atd for at.

This functional is provided by systemd though, e.g.:

	systemd-run --user --on-calendar=12:10 systemctl suspend

There's just one problem: from now on this command will be running
daily, unless you modify the time to include the date. But not only
systemd doesn't allow syntax --on-calendar="today 12:10", even if it
did that would be prone to mistakes when a user has time 21:32 and they
think "I'm gonna schedule a command for today at 00:07", but that isn't
actually "today" but "tomorrow".

So, isn't there an option or something that would allow a user to
specify time without having to worry the timer is going to be executed
more than once?

----------

This was asked on IRC, but the only solution was suggested is doing
some arithmetics with `date` from GNU coreutils.

1:
https://askubuntu.com/questions/339298/conveniently-schedule-a-command-to-run-later




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

  Powered by Linux