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 set up a new ec2 ubuntu server and I'm unable to use rsync to push a file up. I can ssh to the machine with my keypair. I'm not sure why this looks like it works but finishes in half a second and there is nothing in /home/ubuntu on the server.

➜  ~  rsync -av -i ~/.ec2/my-keypair ~/Downloads/pushcom.2012-06-26T01-10-04.gz  ubuntu@stage.push.com
building file list ... done
>f..t.... gsg-keypair
>f..t.... pushwoodcom.2012-06-26T01-10-04.gz

sent 3624 bytes  received 64 bytes  7376.00 bytes/sec
total size is 3392  speedup is 0.92

I've tried 50 different ways of the rsync command but I can't get anything to work. Please help! Thanks

share|improve this question
1  
Don't you need to specify the directory for "ubuntu@stage.push.com"? Something like ubuntu@stage.push.com:/path/to/destination/. –  cjc Jun 27 '12 at 14:34
    
Yes, destination directory is mandatory when pushing files. It's only optional when pulling. –  Magellan Jun 27 '12 at 14:39
    
There is a destination directory -- ubuntu@stage.push.com. –  David Schwartz Jun 27 '12 at 14:39
    
@DavidSchwartz That's not a directory. That's the username and server. The colon is required to delineate a directory. –  Magellan Jun 27 '12 at 14:43
    
@Adrian: That's a path -- ubuntu@stage.push.com is a perfectly legal directory or file name. A colon is only required to specify both a server and a path (including an empty path). Only one thing is being specified here, so no colon is necessary. –  David Schwartz Jun 27 '12 at 14:46
show 4 more comments

1 Answer

try with:

rsync -av -e "ssh -i ~/.ec2/my-keypair" ~/Downloads/pushcom.2012-06-26T01-10-04.gz  ubuntu@stage.push.com:/home/ubuntu/

rsync has different syntax then ssh. Or you may use "scp" which has simmilar syntax as ssh (except with -p/-P for ports)

share|improve this answer
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.