Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

inotifywait-polling.sh does not report file modifications if size did… #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inotifywait-polling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ done
##
watch () {
#echo "watch $1"
find $1 -printf "%s %y %p\\n" | sort -k3 - > $1.inotifywait
find $1 -printf "%s %y %p %T@\\n" | sort -k3 - > $1.inotifywait
while true; do
sleep 2
sign=
last=$(cat $1.inotifywait)
#mv $1.inotifywait $1.$(date +%s).inotifywait
find $1 -printf "%s %y %p\\n" | sort -k3 - > $1.inotifywait
find $1 -printf "%s %y %p %T@\\n" | sort -k3 - > $1.inotifywait
meta=$(diff <(echo "${last}") <(cat "$1.inotifywait")) && true
[[ -z "${meta}" ]] && continue
echo -e "${meta}\n." | while IFS= read line || [[ -n "${line}" ]]; do
Expand Down