0
I just installed inotify-tools.
I would like to continuously detect change of chksum of files under folder /path
Once a change was detect ( under /path ) then it will print
echo “chksum of files under folder /path was change"
example how to check the chksum until now
find /path -type f -name "*.jar" | xargs cksum | awk '{ sum += $1 } END { print sum }'
Little similar case is on:
Continuously detect new file(s) with inotify-tools within multiple directories recursively
#!/bin/sh
MONITORDIR="/path/to/the/dir/to/monitor/"
inotifywait -m -r -e create --format '%w%f' "${MONITORDIR}" | while read NEWFILE
do
echo "This is the body of your mail" | mailx -s "File ${NEWFILE} has been created" "yourmail@addresshere.tld"
done