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.

If someone (i.e. my VPS provider), does the following command, how can I from my ssh know if the copy is complete? Thanks

cp /home/abc/hugeDir /home/cba
share|improve this question
    
In Linux/Unix commands are synchronous unless you send them to background (e.g. by a ` &` appended). The cp command is visible to all users, unless the admin has enabled obfuscations. –  ott-- Jun 21 '13 at 21:04
    
Your question is ambiguous. Some answerers, including the one you accepted, assume you mean "has completed" while others assume you mean that whether anything was missed. –  Dennis Williamson Jun 22 '13 at 2:03
add comment

4 Answers

up vote 6 down vote accepted

You can just check the process list:

ps aux | grep cp

If the prcoess is finished, it will vanish from the list.

share|improve this answer
add comment

Use md5deep on the source directory and when they tell you the copy is complete use it on the destination directory, the output hash should be the same.

share|improve this answer
add comment

There are many approaches; however, I find one to be very easy and simple to apply.

I recommend to use rsync and start a data transfer; if no files are copied, the initial copy must have been complete.

Example command:

rsync -Hav --progress /home/abc/hugeDir /home/cba

If you want to know what the options mean simply type in "man rsync".

share|improve this answer
    
I don't think that's what the OP means. –  SvW Jun 21 '13 at 20:57
add comment

If you know how much they are supposed to transfer you can watch du -hs /path/to/target/dir to see when it reaches the right size.

share|improve this answer
    
You can edit answers, no need to delete and repost. –  SvW Jun 21 '13 at 21:44
    
Yeah, but since the answer contained two solutions it was better to split it. Also, the other solution was, as you said, infeasible. –  l0b0 Jun 21 '13 at 21:45
    
Running du in watch could be very expensive. –  Dennis Williamson Jun 22 '13 at 2:00
add comment

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.