Reputation: 41
I am running forever for my node.js which is great, but when the server restarts I have to rerun the command. Are there any suggestions on how to make it so on reboot or start up, forever automatically launches the script.
Lets say its
forever /var/www/server.js
Thank you!
Upvotes: 4
Views: 5990
Reputation: 1119
Edit crontab:
$ sudo crontab -e
The first time it will ask you which editor you wish to edit with.
Once in the editor add the following line:
@reboot /usr/local/bin/forever start /your/path/to/your/app.js
Save the file.
Reboot.
Upvotes: 5