Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
nodejs forever crontab reboot script
if [ $(ps aux | grep $USER | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ]
export PATH=/usr/local/bin:$PATH
export NODE_ENV=production
cd /path/to/app && forever --spinSleepTime 10000 start server.js >> forever.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.