Hi guys, I cant put my crontab to work. I’m on Ubuntu 14.04x64
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
Result: It doesn’t restarts.
What I’m doing wrong? Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Found the solution myself.
0 * * * * root/.nvm/v0.12.4/bin/node /usr/local/bin/forever restart file.js
Thanks anyway! :)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.