Kill all currently running cron jobs
- by Adelphia
For some reason my cron job scripts aren't exiting cleanly and they're backing up my server. There are currently a couple hundred processes running for one of my users. I can use the following command to kill all processes by that user, but how can I simplify this to kill only crons?
pgrep -U username | while read id ; do kill -6 $id ; done
It would be dangerous to run the above command as is, correct? Wouldn't that kill mysql and other important things?