Cloudbox / autoscan

Autoscan replaces the default Plex and Emby behaviour for picking up changes on the file system.
MIT License
597 stars 49 forks source link

Failure to exclude paths from inotify #148

Open foux opened 2 years ago

foux commented 2 years ago

Hello,

I've got an issue with excluded folders from the IO trigger.

This used to be my trigger definition :

inotify:
    - priority: 0
      verbosity: 2
      include:
        - ^/mnt/user/medias/Movies
        - ^/mnt/user/medias/TV\ Shows
        - ^/mnt/user/medias/Music
      paths:
      - path: /datas/medias
      rewrite:
        - from: /datas/medias
          to: /mnt/user/medias

As I understood it, it should have sufficed, as I've got no problematic folders in my include. Nevertheless, rom time to time I've got the error : ERR Failed watching new directory error="watch directory: /datas/medias/Downloads/nzb/completed/......, while this folder is not supposed to be watched.

Nevermind, I added the excludes explicitely (I've added both the local path and the rewritten path to be sure, even though the rewritten path should have been sufficient) :

inotify:
    - priority: 0
      verbosity: 2
      include:
        - ^/mnt/user/medias/Movies
        - ^/mnt/user/medias/TV\ Shows
        - ^/mnt/user/medias/Music
      exclude:
        - ^/mnt/user/medias/Downloads
        - ^/datas/medias/Downloads
      paths:
      - path: /datas/medias
      rewrite:
        - from: /datas/medias
          to: /mnt/user/medias

But, then again, from time to time : ERR Failed watching new directory error="watch directory: /datas/medias/Downloads/nzb/completed/...

I understand why Autoscan can't watch this folder, as folders and files are being quickly created/deleted, as it's an nzb download folder. What I don't get is why this directory is being watched, when it is not in my included paths, and more than that it is specificaly in my excluded paths.

Thanks!

edrock200 commented 2 years ago

I believe the paths will always be watched, the excludes just means to ignore inotify triggers from said paths. So you can add 3 paths (/data/medias/Movies, /data/medias/TV Shows, etc.) and this should avoid it watching downloads.

saltydk commented 2 years ago

could probably just provide the library paths in a list under paths:

inotify:
  - priority: 0
      verbosity: 2
      include:
        - ^/mnt/user/medias/Movies
        - ^/mnt/user/medias/TV\ Shows
        - ^/mnt/user/medias/Music
      exclude:
        - ^/mnt/user/medias/Downloads
        - ^/datas/medias/Downloads
      paths:
        - path: /datas/medias/Movies
        - path: /datas/medias/TV\ Shows
        - path: /datas/medias/Music
      rewrite:
        - from: /datas/medias
          to: /mnt/user/medias