Skip to content

Instantly share code, notes, and snippets.

@atma
Created December 2, 2012 02:38
Show Gist options
  • Save atma/4186675 to your computer and use it in GitHub Desktop.
Save atma/4186675 to your computer and use it in GitHub Desktop.
@reboot ~/node-app-starter.sh >> cron.log 2>&1
#!/bin/sh
if [ $(ps aux | grep $USER | grep node | grep app.js | grep -v grep | wc -l | tr -s "\n") -eq 0 ]
then
export NODE_ENV=production
export PATH=/usr/local/bin:$PATH
forever start ~/example/app.js > /dev/null
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment