Skip to content

Instantly share code, notes, and snippets.

@178inaba
Last active August 29, 2015 14:21
Show Gist options
  • Save 178inaba/2aebd37ae129c7a524e8 to your computer and use it in GitHub Desktop.
Save 178inaba/2aebd37ae129c7a524e8 to your computer and use it in GitHub Desktop.
ディレクトリ/ファイルを監視してsupervisorで再起動(自動化 ref: http://qiita.com/inaba178/items/f2599b75816f8b779043
#!/bin/sh
if [[ $# -ne 3 ]] ; then
echo argument is invalid.
exit
fi
while :
do
after=`ls -l $1`
if [[ $after != $before && $before != "" ]] ; then
supervisorctl restart $2 > /dev/null
fi
before=$after
sleep $3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment