I have encountered a limitation of the watch command.
Even though I specify watch -n 14400
to run the command every 4 hours or so, the command executes every 4200 or so seconds, which is about an hour's worth of wait. Otherwise very useful command, is there a way to extend the range beyond 4200 seconds.
I think the limit comes from time being measured in microseconds and 4200 million micro seconds, and 4200 M is 2^32 or something.
watch
is the right command here? Maybe you wantat
or acrontab
entry instead. – Warren Young Apr 20 '12 at 06:13while true; do command; sleep 14400; done
, for less permanent setups. – jw013 Apr 20 '12 at 06:18sleep
also takes human postfixes, sosleep 4h
would seem fitting. I made a poor man's watch which might be useful. – gamen Apr 20 '12 at 09:56