Created
January 9, 2015 10:20
-
-
Save janpieterz/37f86c365b7075648d85 to your computer and use it in GitHub Desktop.
How to let node.js run forever on linux.
This file contains 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
npm install -g forever | |
crontab -u nodeuser -e | |
crontab -e | |
Add lines: | |
PATH = $PATH:path_to_node | |
@reboot /usr/local/bin/forever start -c 'node --harmony' /location_of_app | |
to verify use: | |
* * * * * /usr/local/bin/forever start -c 'node --harmony' /location_of_app >> /tmp/cron_debug_log.log 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment