The rw-sleep program

rw-sleep stamp [program arg ...]

rw-sleep sleeps until the given timestamp, or until it receives SIGALRM. (If the given timestamp is in the past, it does not sleep at all.) You can also specify "-" instead of a timstamp; this will make rw-sleep sleep indefinitely until it receives SIGALRM. After sleeping, if no command is given, it exits zero; otherwise, it executes the command with SIGALRM ignored. Ignoring SIGALRM ensures that a late-delivered signal, intended for rw-sleep, will not kill the command. However, a late signal may still cause trouble if the command sets up its own signal handler for SIGALRM.

Some kernels, in violation of SUSv3, may have an upper bound on how long they will let rw-sleep sleep using setitimer() - in particular, Linux 2.6 limits it to about 25 days on 32-bit platforms. You can set up your runwhen invocation to work around this by going back to sleep if rw-sleep wakes up too soon. (Of course, this will also disable intentional early wakeups from SIGALRM.)