Created
September 12, 2013 07:00
-
-
Save danro/6533818 to your computer and use it in GitHub Desktop.
nodejs forever crontab reboot script
This file contains hidden or 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 | |
if [ $(ps aux | grep $USER | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ] | |
then | |
export PATH=/usr/local/bin:$PATH | |
export NODE_ENV=production | |
cd /path/to/app && forever --spinSleepTime 10000 start server.js >> forever.log 2>&1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment