Posts Tagged ‘How to kill zombie process automatically’

Write a script and schedule as a cron job.

for each in `ps auxww | grep Z | grep -v PID | awk ‘{print $3}’`; do for every in `ps auxw | grep $each | grep cron | awk ‘{print $2}’`; do kill -9 $every; done; done