added inotify script
This commit is contained in:
18
scripts/scheduler/inotify.sh
Normal file
18
scripts/scheduler/inotify.sh
Normal 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
|
Reference in New Issue
Block a user