inotifwait不会运行命令
”设置手表。 已建立手表”,脚本刚刚退出
#!/bin/bash
while $(inotifywait -e modify,close_write /home/centos/test.txt);
do
touch /home/centos/log.txt
done
但是当我修改test.txt时log.txt没有创建
尝试了此版本:
#!/bin/bash
inotifywait -e modify,close_write /home/centos/test.txt |
while read output; do
touch /home/centos/log.txt;
done
也尝试过此操作
inotifywait -e modify,close_write /home/centos/test.txt |
while read -r filename event; do
echo "test" # or "./$filename"
done
答案 0 :(得分:2)
通过添加-m /folder