added inotify script

This commit is contained in:
gyurix
2024-11-21 15:11:31 +01:00
parent b9cc2aeab9
commit 5d171d2962

View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Initial parameters
DATE=$(date +%F-%H-%M-%S)
# Set env variables
DIR=$DIR
# Triggers by certificate or domain config changes
unset IFS
inotifywait --exclude "\.(swp|tmp)" -m -e CREATE,CLOSE_WRITE,DELETE,MOVED_TO -r $DIR |
while read dir op file; do
if [ "${op}" == "CLOSE_WRITE,CLOSE" ]; then
echo "new file created: $file"
fi
done