[eside-ghost] Timeout en svn y bash script

Alvaro Uría fermat en movimage.com
Mie Ene 23 01:45:40 CET 2008


Aupi,

Saúl Ibarra [22/01/08 22:34 +0100] escribió:
> He andado buscando un poco, pero no he encontrado, aunque supongo que
> existirá el parámetro imeout o algo así, para hacer un svn co
> --timeout 20 noske pero no lo encuentro... alguna idea?

No sé si 'svn' tendrá '--timeout' (debería xD), pero igual puedes hacer
un trapi a nivel de bash:

->>>>
trap - ALRM
sleep 60 && kill -ALRM $$ & watchdog=$!
#
# svn co ...
#
kill $watchdog
<<<<-

Donde '$$' es el PID del script en ejecución, y '$!' es el PID del
último proceso ejecutado en "background" (o sea, 'sleep').

O incluso,

->>>>
function timeout { echo 'ALARM!!!'; } # xD
trap timeout ALRM
sleep ...
#
# svn co ...
#
kill $watchdog
<<<<-

Saludos,
-- 
    ,____________,
    .'          '.
   /~~~~^~~~^~^~~~\
  /      _    /||  \  Alvaro Uría (0x5109E791)
 ;      ( }   \||D  ;  <fermat at movimage.com>
 |    | /\__,=[_]   |  
 ;  ( |_\_  |---|   ;  It might look like I'm doing nothing, but
  \  )|  |/ |   |  /    at the cellular level I'm really quite busy.
   '. |  /_ |   |.'                     
    '------------'
------------ próxima parte ------------
Se ha borrado un mensaje que no está en formato texto plano...
Nombre     : no disponible
Tipo       : application/pgp-signature
Tamaño     : 189 bytes
Descripción: Digital signature
Url        : https://listas.deusto.es/mailman/private/eside-ghost/attachments/20080123/916c5108/attachment.bin


Más información sobre la lista de distribución eside-ghost