Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have running the following command for 5 hours and still going. mysql has gigabytes of data, but how can I make sure that the following command is actually transferring data. Can someone check the correctness?

tar -czpf - ./ --exclude mysql mysql-bin* mysql.sock | ssh -lroot tar -xzpf - -C /var/lib/mysql 
share|improve this question
May I ask, why you don't use rsync? – polemon Jan 30 '11 at 8:14
up vote 12 down vote accepted

You can insert the pv command into your pipeline to get a report of how many bytes have been transferred, like this:

tar -czpf - ./ --exclude mysql mysql-bin* mysql.sock | 
pv |
ssh -lroot tar -xzpf - -C /var/lib/mysql 

This will give you output like this, including the total number of bytes and the current transfer rate:

 202MB 0:00:13 [  17MB/s] [            <=>                                    ]

You can also just run du -sh on the destination directory.

share|improve this answer

If you have a fast network between the two server, you should try without compression (-C).

To limit the use of CPU, you should change the default encryption algorithm used with "-c blowfish" for instance.

(you can also use ifstat or iptraf to check speed of data exchange)

share|improve this answer

Your Answer


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.