ar- / incron

cron-like daemon which handles filesystem events
Other
229 stars 51 forks source link

Recursive directory watching #8

Closed ar- closed 9 years ago

ar- commented 9 years ago

Watching a directory recursively is not nativlely supported by inotify and so it is not in incron. Even though is is hightly requested, and actually not too complicated to implement.

A possible python extension is here: https://github.com/nguyent/incron-recursive .

In 2013 the Author tried to get funding to implement this feature, whcih brought him 0 cents. That's one of the reasons why he abondenned the project.

Another alternative seems to be https://github.com/gregghz/Watcher .

Obeserving directories recursively, must be added to incron.

ar- commented 9 years ago

https://www.indiegogo.com/projects/recursive-filesystem-monitoring-for-incron

k0lter commented 9 years ago

I fail to see why using the find command through a system call is more stable than a native implementation?

What do you think of the algorithm proposed in the related Debian bug report[1][2]? (IMO, this is the way to go even if it requires more work that it looks to be)

[1] https://bugs.debian.org/443700 [2] https://mail.gnome.org/archives/dashboard-hackers/2004-October/msg00022.html

M.

ar- commented 9 years ago

The algorithm in [2] considered only the recursive creation on directories but not their deletion. Prevention race condiditions for all possible cases (also considering multiple users on the filesystem) is a very complex problem. I could not see that the algorithm in [2] solves the problem finally.

I decided for 2 reasons, to call find(), but I'm also aware that this is usually considered to be more like a 'hack' and it should be done in CPP.

  1. find offered me to include wildcard selectors like *.JPG
  2. find was provable correct, quickly implemented and verifiable, even for people without CPP skills (I considered this feature high on demand - even by myself.

Are there any practical concerns? Eg. is find() not available on some platforms? ARM? SPARC? Not sure about this.

k0lter commented 9 years ago

find (the GNU version) is known to work on all architectures supported by Debian: https://www.debian.org/ports/