In the /etc/incron.allow I added both:
root
USER_1
Then I edited the incrontab so it looks like this:
/var/www/laravel/public/js/main.js IN_MODIFY yui-compressor -o /var/www/laravel/public/js/main.min.js /var/www/laravel/public/js/main.js
I think the issue may have something to do with permissions or perhaps groups but I'm not sure as I'm not getting anything when I check with tail -f /var/log/syslog
The /var/www/laravel/public
folder is owned by USER_1
in group www-data
. Incrond Inotify is done by the root
user. When the main.js file is updated shouldn't Incrond Inotify run regardless of the current user since it's been set by root
? Why isn't it working and how can I make it work with either root
or USER_1
?
答案 0 :(得分:0)
问题是由于权限造成的。它需要对文件执行所有父目录和子目录的读取和执行访问。似乎yui-compressor(Java)必须遍历目录才能到达文件。如果它无法访问目录,则会失败。