Unix: sleep until the specified time
Posted
by
aix
on Super User
See other posts from Super User
or by aix
Published on 2010-12-15T10:24:06Z
Indexed on
2012/10/04
15:42 UTC
Read the original article
Hit count: 217
Is there a (semi-)standard Unix command that would sleep until the time specified on its command line? In other words, I am looking for something similar to sleep
that would take wakeup time rather than duration.
For example: sleeptill 05:00:00
I can code something up but would rather not re-invent the wheel if there's already something out there.
Bonus question: it would be great if it could take the timezone (as in sleeptill 05:00:00 America/New_York
).
edit Due to the nature of what I am doing, I am looking for a "sleep until T" rather than "run command at T" solution.
edit For the avoidance of doubt, if I run the command at 18:00 and tell it to wake up at 17:00, I expect it to sleep for 23 hours (or, in some corner cases having to do with daylight savings time, for 22 or 24 hours.)
© Super User or respective owner