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?

  • 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
| improve this answer | |

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