[UNIX] Alias + Rsync + SSH

A small nifty script, to sync any folder on a local machine to a remote server, and running any command to be executed at the server e.g. in a specified folder

alias sync=”cd <foldertosync@local>
&& rsync -avP –progress -e ssh <foldertosync@local> <username>@<serveraddress>:<foldertosync@server>
&& ssh -X <username>@<serveraddress> -t \”cd <foldertosync@server>; bash –login\””

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.