rsync : how to exclude hidden files and directories ?
Hello everybody !
I'm currently writing a backup script which uses the rsync command. I have to backup the entire directory structure and certain types of files. So, my rsync command looks like this :
In some directories of my source folder, i have hidden files and directories (like ".AppleDouble/", ".DS_Store", ...). I don't want to backup this type of files/directories and anyway, the rsync command returns me errors when it tries to backup them (It's because on the partition of my backup_folder, i cannot create files or directories whose name starts by a dot).
rsync -azd --include='*/' --include='*.nk' --include='*.sni' --include='*.nk.autosave' --exclude='*' --stats /source_folder/* /backup_folder
So, do you know the correct regex to exclude hidden files and directories from my rsync command ?
Thank you in advance ! :-)