Exclude dir exepct some folders

i have an exclude file


it looks like the example on Backing up — restic 0.14.0 documentation
docs say that any files once a dir is excluded you can not later include any files inside.

in my backup script i have

/opt/restic backup --verbose \
        --exclude-file exclude.restic \
    /etc \
    /httpd/conf \
    /httpd/data/auth \
    /httpd/data/ssl.crt \
    /httpd/scripts \
    /httpd/vernetzer \
    /httpd/www > /httpd/logs/restic.log 2>&1

i have a lot of subdirs (only one level) under “fotos”, so i only want to include or backup a selection of foldes (eg. only folder 2022 (and maybe newer)).



** expands to zero or more wildcards, which also includes /httpd/www/htdocs/fotos/*. Thus everything inside the fotos folder is excluded. !/httpd/www/htdocs/fotos/2022/* never applies as it only cancels the previous directive inside the 2022 folder, but the backup never gets there. The fix is to remove several unnecessary wildcards:


thanxs, its working!