Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Unix machine

$ uname -a
SunOS machine-name 5.10 Generic_127112-11 i86pc i386 i86pc

How would I get the number of rsync process running on my unix box. I tried

$ ps -ef | grep rsync 

But it showing me the list of all rsync processes. Is there any way to get exact number of rsync process running?.

in /etc/rsyncd.conf I have set max_connections=150

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Try something like:

ps -ef | grep rsync | wc -l

wc -l will count lines. You should have one line per rsync process.

share|improve this answer
    
thanks Matt...wc -l helped me.... –  meMangesh Mar 21 '13 at 9:18
    
careful with that.. ps -ef | grep rsync also returns the running grep command, so wc -l may return "1" even if no rsync process is running (at least on my linux box it does) -> use ps -ef | grep rsync | grep -v grep | wc -l instead –  Gryphius Mar 21 '13 at 10:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.