Place a timeout on a script?
How do you place a timeout on a script? Lets say ur using tail -f to follow a process but you want the process to end after 12hours nomatter what. or is it even possible?
|
Hi.
There are some limits that can imposed on processes, but I don't think that wall-clock time is one of them. I'd certainly like to hear if there is some such facility. Code:
ulimit [-SHacdflmnpstuv [limit]] I'd use either the tail or perhaps sleep for testing. If you choose this, let us know how it works out. I suspect others may have some ideas as well ... cheers, makyo |
Hi.
If you are not comfortable writing a script version, here's a manual procedure. In one window, you run a command, say: Code:
sleep 1000 Code:
% ps -u makyo | grep sleep Code:
23040 pts/2 00:00:00 sleep Code:
% at now + 1 minute you wish, and terminate with ^D: Code:
at> kill 23040 Code:
job 13 at 2006-10-05 12:54 |
All times are GMT -5. The time now is 03:38 AM. |