This question already has an answer here:

I have the following command that I can run from any folder and it will start my (Angularjs) webapp by using the grunt task runner tool -

cd /root/dev/myapp && grunt serve

However when I put it in cron it doesn't work -

*/1 * * * * cd /root/dev/myapp && grunt serve

Any ideas on why it is not working?

marked as duplicate by David Foerster, Eric Carvalho, mikewhatever, Eliah Kagan, muru Apr 5 '15 at 9:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    The most common problem with cron is cron runs with a minimal shell and minimal environmental variables. Use the full path to scripts, /root/dev/myapp/grunt serve depends on what "grunt" is exactly. You may need to put it in a more standard location such as /usr/local – Panther Apr 2 '15 at 14:09
  • Just copped it as you posted! – sonicboom Apr 2 '15 at 14:10

I had to set the path to grunt -

*/1 * * * * cd /root/dev/myapp && /usr/bin/local/grunt serve

Not the answer you're looking for? Browse other questions tagged or ask your own question.