Skip to content

Instantly share code, notes, and snippets.

@Mierenga
Last active April 17, 2018 15:03
Show Gist options
  • Save Mierenga/6e4710a4f4c9383a683a32af558de94c to your computer and use it in GitHub Desktop.
Save Mierenga/6e4710a4f4c9383a683a32af558de94c to your computer and use it in GitHub Desktop.
APP=apptemplate
# kill any running instance │
~/$APP/kill.sh │
# setup log ownership
sudo chown pi /var/$APP/log │
sudo chown pi /var/$APP/tmp │
touch /var/$APP/log/node.log │
touch /var/$APP/log/node.err │
touch /var/$APP/log/python.log
# clear cached photos
rm -r /var/$APP/tmp/photo/* │
################# │
# NODE SERVICE # │
################# │
cd ~/$APP/src/node │
node app.js > /var/$APP/log/node.log 2>&1 & │
################# │
# PYTHON APP # │
################# │
cd ~/$APP/src/python/ │
# run with -u for unbuffered (always flushed) logging │
pipenv run python3 -u app.py > /var/$APP/log/python.log 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment