Operating System - HP-UX
1844059 Members
3209 Online
110227 Solutions
New Discussion

script for killing all ftpd sessions

 
Deepu Chakravarty
Regular Advisor

script for killing all ftpd sessions

I have many ftp sessions in my server (rp7420 HPUX 11.11). I need to kill all these ftpd sessions periodically. I am using following command to kill these sessions:
kill -9 ` ps -ef|grep ftpd|awk '{print $2}'`
. This line I have added in one file and running the file with a cron job. But the cron job is itself killing the first ftpd job it is finding and not the other ftp sessions.
How it can be achieved? Thanks in advance.
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: script for killing all ftpd sessions

Add -9 if it fails:
kill $(UNIX95=EXTENDED_PS ps -C ftpd -opid=)
Deepu Chakravarty
Regular Advisor

Re: script for killing all ftpd sessions

I have able to done. Thanks.
Dennis Handly
Acclaimed Contributor

Re: script for killing all ftpd sessions

If you are happy with the answers, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33