Last active
April 30, 2018 20:25
-
-
Save magician11/942c2a941b4a394d35d186d1009a703b to your computer and use it in GitHub Desktop.
How to automatically restart a Node.js script (with forever) on a server reboot
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
NODE_ENV=production | |
PATH=/root/.nvm/versions/node/v8.11.1/bin:$PATH | |
@reboot cd /var/server/script-directory && /root/.nvm/versions/node/v8.11.1/bin/forever start myscript.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment