[CentOS] Timeout for a script
Ian Blackwell
ian at ikel.id.auWed Nov 12 10:13:37 UTC 2008
- Previous message: [CentOS] Timeout for a script
- Next message: [CentOS] Timeout for a script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jussi Hirvi wrote: > How could I make a script time out after nn minutes, if it's not finished by > then? > I put this little test script together. It seems to work OK... #!/bin/bash timeoutseconds=5 pid=$$ (echo Will kill $pid in $timeoutseconds seconds; sleep $timeoutseconds; kill -1 $pid) & while true do echo Hello sleep 0.6 done You may need to vary the signal in the kill statement, depending on what you're running. Ian
- Previous message: [CentOS] Timeout for a script
- Next message: [CentOS] Timeout for a script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list