|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi there.
Is there any simple way to allow program running for specific time and then just kill it? I.e. like : $> time ./script.sh gives how long script was running I would like to have sth. like let's say command "timer": $> timer 10m ./script.sh Which would allow script to be alive for 10 minutes and then it would kill it. Is it possible to do this some easy way or I need to kill it manually from other script? Greetings Yatsek |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
yatsek@gmail.com wrote:
> > Is there any simple way to allow program running for specific time and > then just kill it? I.e. like : > > $> time ./script.sh > > gives how long script was running I would like to have sth. like let's > say command "timer": > > $> timer 10m ./script.sh > > Which would allow script to be alive for 10 minutes and then it would > kill it. Is it possible to do this some easy way or I need to kill it > manually from other script? http://groups.google.de/group/comp.u...c83025322c7c86 -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Jan 7, 4:28pm, Cyrus Kriticos <cyrus.kriti...@googlemail.com>
wrote: > yat...@gmail.com wrote: > > > http://groups.google.de/group/comp.u...c83025322c7c86 > yupi!!! works ![]() Big thx -- Yatsek |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Mon, 07 Jan 2008 16:28:39 +0100, Cyrus Kriticos wrote:
> yatsek@gmail.com wrote: >> >> Is there any simple way to allow program running for specific time and >> then just kill it? I.e. like : >> >> $> time ./script.sh >> >> gives how long script was running I would like to have sth. like let's >> say command "timer": >> >> $> timer 10m ./script.sh >> >> Which would allow script to be alive for 10 minutes and then it would >> kill it. Is it possible to do this some easy way or I need to kill it >> manually from other script? > > http://groups.google.de/group/comp.u...c83025322c7c86 Here's a program I wrote to do the same thing: http://stromberg.dnsalias.org/~strombrg/maxtime.html ....but glancing at the other one, I believe mine will: 1) Be more granular - not necessarily a good thing 2) Be less busy-waiting - means less CPU load I've used in a number of contexts, including with NFS hard mounts from unreliable servers. |
|
![]() |
| Outils de la discussion | |
|
|