Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am on shared hosting and I'm trying to schedule cronjob to run every now and then. Via cPanel I scheduled to execute my script but even though that according to my host support the cronjob runs, the script doesn't seem as doing anything. The cron job command I set via cPanel is:

/bin/sh /home1/myusername/public_html/somefolder/

and the

/home1/myusername/public_html/somefolder/node_modules/forever/bin/forever stop 0

when via SSH I execute:


it stops forever process as needed. From cronjob doesn't do anything.

How can I get this working?


So I've tried:

/bin/sh /home1/username/public_html/somefolder/ >> /tmp/mylog 2>&1

and mylog entries say:

/usr/bin/env: node: No such file or directory

It seems that forever needs to run node and this cannot be found. How would I possibly fix this?

share|improve this question
It should do it, but I want to ask to you: does it stop forever process even if you execute the script with `/bin/sh /home1/myusername/public_html/somefolder/'? – Hastur Jun 3 '14 at 22:36
if I execute script `/bin/sh /home1/myusername/public_html/somefolder/' it does work. I also updated my answer – spirytus Jun 4 '14 at 0:20
up vote 1 down vote accepted

You may need to define your PATH and other environment variables at the start of your script. Type "set" to show their values in your current shell, then copy/paste whatever you need, adding lines until your script works.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .