Skip to content

Instantly share code, notes, and snippets.

@janpieterz
Created January 9, 2015 10:20
Show Gist options
  • Save janpieterz/37f86c365b7075648d85 to your computer and use it in GitHub Desktop.
Save janpieterz/37f86c365b7075648d85 to your computer and use it in GitHub Desktop.
How to let node.js run forever on linux.
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