用 node.js 的 forever 執行其他非 node.js 程式

某種程度上可以當作土炮 service 用

有時候因為一些限制,沒辦法把程式註冊成 service 來用,但又要程式可以持續執行,就可以利用 node.js 的 forever 套件來幫忙。

forever start -a -l /path/to/myscript_forever.log -o /path/to/myscript_out.log -e /path/to/myscript_err.log -c php myscript.php

Reference: https://stackoverflow.com/questions/18226076/is-there-a-forever-js-equivalent-for-php-to-run-my-scripts-continuously