Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使inotifywait监视符号链接_Linux_Shell_Filesystemwatcher - Fatal编程技术网

Linux 使inotifywait监视符号链接

Linux 使inotifywait监视符号链接,linux,shell,filesystemwatcher,Linux,Shell,Filesystemwatcher,我正在搜索一种通知层次结构修改的方法,但我有符号链接,我希望对修改文件上的每个符号链接都有一个明确的通知 一个诀窍是使用find找到它们,但我更喜欢更干净的东西:我想到了这样的东西,它很管用,但我不喜欢它: for f in $(find -L $SOURCE_DIR -samefile "$folder$file") do if [ -L "$f" ] then do_something_with_the_link $(dirname "$f")/ $(base

我正在搜索一种通知层次结构修改的方法,但我有符号链接,我希望对修改文件上的每个符号链接都有一个明确的通知


一个诀窍是使用find找到它们,但我更喜欢更干净的东西:

我想到了这样的东西,它很管用,但我不喜欢它:

for f in $(find -L $SOURCE_DIR -samefile "$folder$file")
do
    if [ -L "$f" ]
    then
        do_something_with_the_link $(dirname "$f")/ $(basename "$f")
    fi
done

我想到了这样的东西,它是有效的,但我不喜欢它:

for f in $(find -L $SOURCE_DIR -samefile "$folder$file")
do
    if [ -L "$f" ]
    then
        do_something_with_the_link $(dirname "$f")/ $(basename "$f")
    fi
done

实际符号链接(而非实际文件)的更改频率如何?他们一整天都保持静止吗?实际的符号链接而不是实际的文件多久会改变一次?他们一整天都不动吗?