Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to rsync my local files with a backup which I have on a server which allows access from where I am right now only via a gateway. So I came up with the following

rsync -avz -r --stats --progress -e "ssh gateway.dot.com ssh server.dot.com:/home/myname/documents/" /home/myname/documents 

and there is some communication going on as all the files get listed but at the summary at the end reveals that there was actually no file trasfer at all.

Number of files: 270889
Number of files transferred: 0
Total file size: 70343212868 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 7596005
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 7613770
Total bytes received: 17764

sent 7613770 bytes  received 17764 bytes  50707.87 bytes/sec
total size is 70343212868  speedup is 9217.44

Ideas?

share|improve this question
    
Maybe all files are already in sync and there is no transfer necessary??? –  crayzeewulf Mar 22 '13 at 0:47
    
In fact they are not. It absolutely looks like it but there are hundreds of changes and several newly generated files in these folders and subfolders. –  Giant Molecular Klaus Mar 22 '13 at 20:11
    
Just to clarify - the newer files are on the server and I want to get them on my local machine. –  Giant Molecular Klaus Mar 22 '13 at 20:13
    
many thx to user crayzeewulf: the answer is rsync -avz -r --stats --progress -e "ssh gateway.dot.com ssh" server.dot.com:/home/myname/documents/ /home/myname/documents –  Giant Molecular Klaus Mar 22 '13 at 20:46

2 Answers 2

up vote 1 down vote accepted
  1. Shouldn't the rsync command be rsync ... -e "ssh the.gateway ssh" /local/dir/ the.remote.server:/remote/dir/?
  2. The message speedup is 9217.44 shows that the transfer is 9217 times optimized, that's to say the files between the two hosts are almost (if not already) sync'd.

UPDATE AGAIN:

#2 is not correct. See crayzeewulf's answer for more explanation. The speedup value misled me to understand that it worked.

share|improve this answer
    
Thx for the answer and the comments! #2: The files are not in sync, there are hundreds of files that were changed and some were added. #1: in this case I get "bash: the.remote.server: command not found..." –  Giant Molecular Klaus Mar 22 '13 at 20:08
    
@clarkw, you were correct originally. See my answer. –  crayzeewulf Mar 22 '13 at 20:45
    
Oh yeah, I see it also now. Sorry for the confusion guys and thanks a lot for your help! –  Giant Molecular Klaus Mar 22 '13 at 20:55
1  
@crayzeewulf: Thanks. The speedup values misled me. Updated my answer to not confuse more people. :) –  whjm Mar 23 '13 at 1:34

I think item#1 in clarkw's answer is correct. If you use ...-e "ssh gateway.dot.com ssh server.dot.com:/home/myname/documents/", the corresponding rsync command has a source directory but no destination directory. In this case, according to the rsync manual:

Usages with just one SRC arg and no DEST arg will list the source 
files instead of copying.

This is exactly what is going on. You can check this by providing garbage as the -e argument. For example:

rsync -avz --stats -e 'suq maballs' /tmp

This command will work just fine. It will list everything under /tmp and display nice stats at the end:

Number of files: 28
Number of files transferred: 0
Total file size: 182 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 955
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 998
Total bytes received: 26

sent 998 bytes  received 26 bytes  2048.00 bytes/sec
total size is 182  speedup is 0.18

Notice that no files are transferred here just as in your example. You need to modify your original command:

rsync -avz -r --stats --progress \
    -e "ssh gateway.dot.com ssh server.dot.com:/home/myname/documents/" \
    /home/myname/documents 

to:

rsync -avz -r --stats --progress \
    -e "ssh gateway.dot.com ssh" \
    server.dot.com:/home/myname/documents/ \
    /home/myname/documents  

Of course, replace gateway.dot.com and server.dot.com with the appropriate host names.

share|improve this answer
    
WOW THX! That works perfect :) I would never have gotten that right without help. Just as a remark, there is one " too much in your solution-command. –  Giant Molecular Klaus Mar 22 '13 at 20:44
    
Glad to see that it worked. @clarkw had it right the first time. Also, thanks for reporting my mistake. I have fixed it. Please accept an answer if you are satisfied. –  crayzeewulf Mar 22 '13 at 20:47

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.