CodePudding user response:
FILE_THIS="/var/TMP/this. TXT"
FILE_LAST="/var/TMP/last. TXT"
FOLDER="/var/TMP/aaa/"
While:; Do
If [-e "$FILE_THIS"]; Then
"$FILE_THIS" mv "$FILE_LAST
"Ls "$FOLDER" & gt; "$FILE_THIS
""$FILE_THIS" diff "$FILE_LAST
"If [$?==0]; Then
Echo the Not changed
The else
Echo Changed
Fi
The else
Ls "$FOLDER" & gt; "$FILE_THIS
"Fi
# can be changed by adjusting the time to sleep monitoring frequency
Sleep 5
The done
CodePudding user response:
. You can learn more about the file monitorWay