forever is
A simple CLI tool for ensuring that a given script runs continuously.
For now it only supports nodejs scripts.
It provides functions like nohup
in shell, but much more.
To start your script, run forever start -w app.js
instead of node app.js
.
The "-w" option will watch the file changes.
So update website is simply run git pull ...
on your production host,
forever will find the changes in your sources and restart server
(like Meteor app in develop mode).
List all running forever managed scripts with forever list
.
Find out their logs location with forever logs
.
Then you can use tail -f
to watch the log of a script in real time.
Print the log of a script with forever logs <script-index>
,
for example:forever logs 0
.
You get the index from the output of forever logs
.