Monitors the script specified in the current process or as a daemon


  The forever process will run as a daemon which will make the target process start

  in the background. This is extremely useful for remote starting simple node.js scripts

  without using nohup. It is recommended to run start with -o -l, & -e.

  ex. forever start -l forever.log -o out.log -e err.log my-daemon.js


start Start SCRIPT as a daemon
stop Stop the daemon SCRIPT
stopall Stop all running forever scripts
restart Restart the daemon SCRIPT
restartall Restart all running forever scripts
list List all running forever scripts
config Lists all forever user configuration
set Sets the specified forever config
clear Clears the specified forever config
logs Lists log files for all forever processes
logs <script|index> Tails the logs for <script|index>
columns add
Adds the specified column to the output in `forever list`
columns rm
Removed the specified column from the output in `forever list`
columns set Set all columns for the output in `forever list`
columns reset Resets all columns to defaults for the output in `forever list`
cleanlogs [CAREFUL] Deletes all historical forever log files



forever list


forever restart myscript.js


forever stop --sourceDir=/data/nodejs/ start.js

-l 指定log所在位置, -e 指定错误日志,-o指console的输出,-a 追加的方式,平时使用时最好把-l, -e, -o全用上。

forever start -l /var/log/nodejs/log -e /var/log/nodejs/error -o /var/log/nodejs/out.log -a --sourceDir=/data/nodejs start.js


电子邮件地址不会被公开。 必填项已用*标注