Last active
December 30, 2022 12:07
-
-
Save jeansymolanza/98c463bb8893b39b71d3effa45e0b53a to your computer and use it in GitHub Desktop.
This file contains 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
ps -eo pid,etime,comm,user | awk '{if ($3 ~ /KL/ || $3 ~ /kl/ && $2>604800) print $1, $4}' | while read pid user; do kill $pid; echo "Killed $pid process owned by $user which started running at $(ps -o lstart= -p $pid)" >> processes.txt; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment