Skip to content

Instantly share code, notes, and snippets.

@metasov
Created April 22, 2015 21:34
Show Gist options
  • Save metasov/8f512599729dfdb25686 to your computer and use it in GitHub Desktop.
Save metasov/8f512599729dfdb25686 to your computer and use it in GitHub Desktop.
inotifywait
archim@monitoring:/etc/smokeping$ cat watch.sh
#!/bin/bash
cd /etc/smokeping/config.d
while :; do
inotifywait -e CLOSE_WRITE /etc/smokeping/config.d/*
for f in *config.txt; do
python /etc/smokeping/convert.py $f > `basename $f .txt`_converted.txt
done
invoke-rc.d smokeping restart
done
archim@monitoring:/etc/smokeping$ grep watch.sh /etc/rc.local
screen -S inotify-smokeping-reload -d -m -- /etc/smokeping/watch.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment