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 was wondering if I could get some help with this rsync command. I am trying to copy files from a remote system by running rsync on the local system.

Here is my command:

/usr/bin/rsync -avz serverbackup@SERVERIP:/home/serverrestore/game1/20132508.tar.gz /home/username/game1/ 'ssh -i /etc/claire/key'

However I am getting this error here:

Unexpected local arg: /home/nharasym/game257/
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1246) [Receiver=3.0.9]

Any ideas on how to solve this problem?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You are missing -e argument before the ssh code, and also, it should be before the source and destination. The following command should work (provided the permissions on the key file and enclosing directory are satisfactorily secured per the standard requirements of ssh)

/usr/bin/rsync -avz -e 'ssh -i /etc/claire/key' serverbackup@SERVERIP:/home/serverrestore/game1/20132508.tar.gz /home/username/game1/
share|improve this answer
    
That works, thank you very much –  icebox3d Aug 26 '13 at 3:09

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.