Use Rsync on a non-standard port

A post which is not necessarily in direct relation with the Raspberry Pibut I have found this problem to synchronize a directory on the small card !

Rsync and Raspberry Pi with non-standard SSH port

At home, the development is done on a laptop (a Mac in this case) for questions of mobility and performance. The RAM and processor help for server stops/starts, the debug in the browser console, etc.

Once the development completed or to test, sources sent thanks to Rsync. NodeJS, It is great but about the amount of files it's not light ! So rather than doing a tar of my file (over 280Mb !) and send it to the Raspberry Pi via scp, I go through Rsync.


Yes but this is, as I do things in complicated ways, Raspberry Pi is in fact a local virtual machine running under Qemu. The standard port 22 of this machine is redirected to another port (the 5022 in my case) in order to be accessible from the Mac.

The magic option that I have time to find is -e ! It allows to set the connection to use. The command to make the copy becomes :

rsync-avz-e "ssh-p 5022" My-Folder pi@* <! [CDATA [*/! function () {try {var t = "currentScript" in document?document.currentScript:function(){for(var t=document.getElementsByTagName("script"),e=t.length;e--;)if(t[e].getAttribute("cf-hash"))return t[e]}();if(t&&t.previousSibling){var e,r,n,i,c=t.previousSibling,a=c.getAttribute("data-cfemail");if(a){for(e="",r=parseInt(a.substr(0,2),16),n=2;a.length-n;n =2)i=parseInt(a.substr(n,2),16)^r,e =String.fromCharCode(i);e=document.createTextNode(e),c.parentnode.replacechild(e,c)}}}catch(u){}}();/*]] > */:/home/pi/

The option -e here will create an SSH connection using port 5022.

Voilà. As freeing memory or aide-mémoire of the major commands on UNIX, I share the small options that can help !

Thanks Rsync !

You may also like...