script/command to kill processes running on particular port
I want know, "Can we write some shell script that will kill all the processes running on particular port.. I want to run that script daily by cron... " I have written a server that runs some port say 3001 on my Mandrake server.. Now I need to restart that server daily with cron.. but when I try to end that server, its processes running on port 3001 does not terminate.. I need to kill those processes and start my server again..
I hope I am clear.. Please help |
Something like
Code:
lsof | grep IPv | grep 3001 | awk '{print $2}' | xargs -l -i kill -9 {} Cheers, Tink |
ahh
that's too funny (the cross posting) I take it back it's not mean :P |
All times are GMT -5. The time now is 11:30 PM. |