Rsync Remote To Local Issue

5,446

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:
5,446

Related videos on Youtube

icebox3d
Author by

icebox3d

Updated on September 18, 2022

Comments

  • icebox3d
    icebox3d over 1 year

    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?