Rsync exclude wildcard files from the filter file

rsync

I have noticed that rsync have

    --exclude=PATTERN       exclude files matching PATTERN
    --exclude-from=FILE     read exclude patterns from FILE

switches, but couldn't I just exclude files from the filter file what I use anyway?

cat << EOF >> $FILTER
+ /home
- /*.iso
- /*.mp3
- /*
EOF

Doesn't seems to work.

Best Answer

"*" does not match "/" so unless you have mp3 and iso files in the root of the source then that won't have any effect. Use "**" to let the pattern also match slashes.