Skip to content

Instantly share code, notes, and snippets.

@dubcl
Last active March 19, 2018 14:12
Show Gist options
  • Save dubcl/c9a24df5af4e3d323097ca784c5290e0 to your computer and use it in GitHub Desktop.
Save dubcl/c9a24df5af4e3d323097ca784c5290e0 to your computer and use it in GitHub Desktop.
Kill process older than
#!/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