Last active
March 19, 2018 14:12
-
-
Save dubcl/c9a24df5af4e3d323097ca784c5290e0 to your computer and use it in GitHub Desktop.
Kill process older than
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APPNAME=$1 | |
USER=$(whoami) | |
for PID in $(pgrep -u $USER $APPNAME); do TIME=$(ps --noheaders -o etimes $PID); if [ $TIME -gt 60 ];then kill -9 $PID;fi ;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment