Organizational Research By

Surprising Reserch Topic

Crontab + Forever + node.js + NPM


So, this is what I did:

.root
.pw
.sudo apt-get update
.sudo apt-get install nodejs
.sudo apt-get install npm
.curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash
[I reload Putty]
.nvm install 0.12
.npm install steam
[Now I go to filezilla, upload the file.js into root directory]
.nvm use 0.12
.node file.js
[It executes the file.js sucessfuly, I reload Putty]
.nvm use 0.12
.npm install forever -g
.forever start file.js
[It will execute the file.js infinitely]

Now I want a restart to execute this commands. The thing is that "forever start" will not execute if I dont execute the "nvm use 0.12" in first place.

So:
.crontab -e
.nano
.*/5 * * * * nvm use 0.12 && forever start file.js
ctrl + x
saved
asked Jun 9, 2015 in LINUX by rajesh
0 votes
84 views



Related Hot Questions



Government Jobs Opening


...