Created
October 16, 2014 11:45
-
-
Save mengzhuo/8687d7205c71a2bb00d4 to your computer and use it in GitHub Desktop.
Auto reload by inotify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Can reload after file changed/modified/created/deleted | |
echo "Auto reload" | |
while true; do | |
ps aux | grep start.py | awk '{print $2}' | xargs kill > /dev/null | |
$VIRTUAL_ENV/bin/python $PWD/start.py -c ~/config.ini & | |
inotifywait -r --format '%:e %f' -e modify -e create --exclude="(^svn|\.(swp|pyc|swx|db|swpx)$|^wc)" $PWD | |
echo "reloading..." | |
sleep 0.4 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment