To use timeout killer functionality use the following instructions:
- Download
timeout-killer.sh - Replace PROGRAM_REGEXP and TIMEOUT to your own values
- Add executable rights
chmod +x timeout-killer.sh - Run timeout killer
./timeout-killer.sh
| #!/bin/bash | |
| PROGRAM_REGEXP=HERE_YOUR_PROGRAM_NAME | |
| TIMEOUT=300 | |
| kill -9 $(ps -eo comm,pid,etimes | awk -v TIMEOUT=$TIMEOUT -v PROGRAM_REGEXP=$PROGRAM_REGEXP '$0 ~ PROGRAM_REGEXP {if ($3 > TIMEOUT) { print $2}}') |