1
I can start my node.js script as a process like so:
start demo
because in /etc/init/demo.conf
i have:
respawn
respawn limit unlimited
exec node /home/engine/private_js/demo.js >> /home/engine/logs/demo.log 2>&1
But if I do nano crontab -e
and put ether of the following ...
*/1 * * * * start demo
1 * * * * start demo
* * * * * start demo
*/1 * * * * node /home/engine/private_js/demo.js
1 * * * * node /home/engine/private_js/demo.js
* * * * * node /home/engine/private_js/demo.js
*/1 * * * * /usr/local/bin/node /home/engine/private_js/demo.js
1 * * * * /usr/local/bin/node /home/engine/private_js/demo.js
* * * * * /usr/local/bin/node /home/engine/private_js/demo.js
... then /etc/init.d/crond restart
and wait one minute, nothing happens.
I am trying to get my node.js script to start after one minute and always check each minute even though I have the respawns (I want to be "double safe than sorry") and this method would also be good for when the server may go-down or restart for whatever reason.