How to excludes some files in rsync

rsync

I am backing up data from a folder in MAC.
The MAC unnecessarily creates some files startinmg with . like

.dsdfsd or ._hjdds

Now i want to exclude the files starting with . in rsync .

How can i do that

Best Answer

If you search in the rsync man page for "exclude", you will find:

--exclude=PATTERN exclude files matching PATTERN

So this would probably work:

rsync --exclude='.*' [other arguments]