Skip to content

Instantly share code, notes, and snippets.

@vkurup
Created June 15, 2010 15:03
Show Gist options
  • Save vkurup/439230 to your computer and use it in GitHub Desktop.
Save vkurup/439230 to your computer and use it in GitHub Desktop.
Watch a blogofile directory and rebuild if a change is noticed.
#!/bin/bash
BLOGOFILE='/usr/local/bin/blogofile'
BLOGDIR='/home/vinod/web/blogofile'
while LINE=$(inotifywait -rq --timefmt '%F %R' --format '%T %e %f' -e close_write -e move -e delete "$BLOGDIR");
do
cd $BLOGDIR
$BLOGOFILE build
echo "Rebuilt: $LINE"
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment