This advertisement helps me to keep writing articles on this website

Use RSYNC to Synchronise a directory to a linux server

To synchronize files between your local machine and a server, you can download software but did you know you can also do it with one single terminal command?

Synchronise files to server

This command will synchronise the contents from local sourcefolder to targetfolder on the server and will prompt for the server password.

rsync -zaP --delete ./sourcefolder/. loginname@yourserver.com:~/targetfolder

Meaning of the parameters

parameter description
z compress data during the transfer
a archive files and directory while synchronizing. Ensures recursion
P show progress during transfer
–delete delete files on the server that are not on the sending side
Written by Loek van den Ouweland on October 15, 2020. Questions regarding this artice? You can send them to the address below.
By using this site, you acknowledge that you have read and understand our Cookie and Privacy Policy.