I'm trying to run a shell script at a specific time up to it's seconds (H:M:S) , but so far all programs such as at
only go up to a specific minute (not second).
I don't want to use sleep
since it's not accurate. For some reason it ended couple of hours earlier than it was supposed to!
Asked
Active
Viewed 565 times
2

user692942
- 16,398
- 7
- 76
- 175

user3334860
- 53
- 2
- 6
-
Show us more details? – Hugo Sousa Feb 20 '14 at 22:43
-
Sleeps can be interrupted, the pattern is `while (now < scheduled) sleep(scheduled - now);` – bobah Feb 20 '14 at 23:04
1 Answers
1
Your question doesn't seem to define accuracy, but there is always some jitter in scheduling in electronic devices. You might use quartz to schedule to the second. You could also use at
or cron
to schedule to the minute and then sleep the appropriate number of second(s).

Elliott Frisch
- 198,278
- 20
- 158
- 249