I’ve searched all over the internet and everybody suggests the same thing - that adding --exclude=´.*´
should exclude hidden files and folders from an rsync. It doesn’t. I´ve also tried adding a slash and/or double quotes eg. --exclude=¨\.*¨
Nothing seems to work. AGH!! Would really appreciate some help.
Both versions you are showing are wrong. You need to use double quotes. The following works and excludes hidden files and directories:
If you only want to exclude hidden directories:
I use this expression:
--exclude=".[!.]*"
Does the job well for me excluding hidden files and directories.
Open a text file
exclude_me.txt
and type the following:.[a-z]*
Then execute the following:
--exclude="/.*"
your\
is pointing the wrong way .This is the
rsync
command I use to make a copy of my local Dropbox folder, from my MacBook (MacOS) to an external network drive (mounted as extdisk below).rsync -atv --delete --delete-excluded --exclude "DontCopyThisFolder" --exclude=".*" "/Users/admin/Dropbox/" "/Volumes/extdisk/Files/Dropbox/"
It uses the options:
Further documentation and options can be found at the rsync Man Page