Sleep until a specific time/date

As mentioned by Outlaw Programmer, I think the solution is just to sleep for the correct number of seconds. To do this in bash, do the following: current_epoch=$(date +%s) target_epoch=$(date -d ’01/01/2010 12:00′ +%s) sleep_seconds=$(( $target_epoch – $current_epoch )) sleep $sleep_seconds To add precision down to nanoseconds (effectively more around milliseconds) use e.g. this syntax: …

Read more