Page 1 of 1

[SOLVED]rsync over SSH syntax problem

PostPosted: Jul 1st, '16, 20:38
by mackowiakp
I want to rsync data FROM Synology TO my M5 server. Rsync server works on Synology and it is possible to rsync in unencrypted form:

Code: Select all
rsync --delete --password-file /home/media/Pobrane/pass1 -avrt root@example.synology.me::LAMIA /home/media/disk-1/TMP


I can login to Synology over SSH without problems. I use port 666 instead 22.

But when I try to run rsync over SSH client on M% it returns me an syntax error. I googled a lot but I dont know what I am doing wrong. Any help? Below command I use and output:

Code: Select all
[root@mackowiak Pobrane]# rsync --delete -vratx "ssh -x -p 666 -i /home/media/.ssh/id_media" root@example.synology.me:LAMIA /home/media/disk-1/TMP
Unexpected remote arg: root@example.synology.me:LAMIA
rsync error: syntax or usage error (code 1) at main.c(1330) [sender=3.1.1]


Any help?

Re: rsync over SSH syntax problem

PostPosted: Jul 1st, '16, 21:25
by Ken-Bergen
In the first command you use
Code: Select all
me::LAMIA
In the second
Code: Select all
me:LAMIA
The error message says that is a problem.

Re: rsync over SSH syntax problem

PostPosted: Jul 1st, '16, 22:47
by mackowiakp
No, it is not the problem. Look at output:

Code: Select all
[root@mackowiak Pobrane]# rsync --delete -vax "ssh -x -p 666 -i /home/media/.ssh/id_media" root@example.synology.me::LAMIA /home/media/disk-1/TMP
Unexpected remote arg: root@example.synology.me::LAMIA
rsync error: syntax or usage error (code 1) at main.c(1330) [sender=3.1.1]


BTW. Single ":" character must be use when rsync run over SSH. It works me correctly when I rsync files FROM client TO server. But i want to do rsync in opposite direction.

Re: rsync over SSH syntax problem

PostPosted: Jul 2nd, '16, 17:35
by doktor5000
With the command you posted you try to sync a folder ":LAMIA" from the home folder of the root account on the synology box to /home/media/disk-1/TMP. Is there a folder :LAMIA in the home folder of the root account ?
Also to specify a custom ssh command usually one has to use -e "ssh -ssh_options_here" and you're missing the -e

Would also be helpful if you could provide the absolute path you want to sync on the synology box here.

Re: rsync over SSH syntax problem

PostPosted: Jul 3rd, '16, 10:19
by mackowiakp
THX for Your help. Problem solved. now I use such command:

Code: Select all
rsync --delete -vax -e ssh lamia:/volume1/homes/piotr.mackowiak/EPI /home/media/disk-1/TMP


Where "lamia" is a host defined in ~/.ssh/config file. The definition of that host is:

Code: Select all
Host lamia
    HostName my_host.synology.me
    User root
        port 666
        ForwardX11 no
    IdentityFile /home/media/.ssh/id_media


THX one more for Your help and wish You good health after yesterdays "hertz klekot" during Fußballspiel with Italy :lol: