1

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?

sonicboom
  • 223
  • 1
  • 2
  • 6
  • 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 02 '15 at 14:09
  • Just copped it as you posted! – sonicboom Apr 02 '15 at 14:10

1 Answers1

2

I had to set the path to grunt -

*/1 * * * * cd /root/dev/myapp && /usr/bin/local/grunt serve
sonicboom
  • 223
  • 1
  • 2
  • 6