cln*_*agu 3 linux inotify exclude
我正在使用 incron 来监视目录中的事件,但我想排除某些子目录或某些文件名模式。
有什么办法可以优雅地做到这一点吗?
您无法通过 进行排除incrontab
。您可以显式列出文件,也可以创建一个包装器来过滤您不想处理的文件。
一个超级简单的包装器:
#!/bin/bash
if ! grep -q $1 /path/to/incron.excludes
then
exec /path/to/realscript.sh $1
fi
Run Code Online (Sandbox Code Playgroud)