How to avoid creating new files at the target using rsync

| | 1 min read

rsync is a file and folder synchronisation tool in linux. To know more about rsync please go through this link:
http://www.zyxware.com/articles/2717/how-to-backupcopysynchronise-a-full-folder-lying-on-a-remote-server-onto-another-localremote-machine-easily-using-

rsync usually creates files or folders that are present in source to the destination folder. But if you want to avoid creating new files created at source to the destination folder then use the 'rsync --existing' command. This will only rsync the folders present at source to destination.

rsync -avz --existing source destination

This will rsync the folders and will synchronise only the files and folders that are present at the source folder and keep both source and destination equal.