0

I have this bash script in runtests.sh file

#!/bin/bash
cd /Library/WebServer/Documents/protractor_clipboards
protractor testscript.js

When I do this on terminal

./runtests.sh 

But when I try to run it from crontab -e file I get this error

/Library/WebServer/Documents/test/runtests.sh: line 3: protractor: command not found

I know that protractor is the command works but not sure whats going on

here is my crontab -e

*/5 * * * *  /Library/WebServer/Documents/test/runtests.sh

Thanks

user50946
  • 473
  • 2
  • 7
  • 18

1 Answers1

3

You need to set the PATH at the beginning of the script or use the full path to protractor. cron uses a default PATH while yours is likely modified by some rc file.

jlliagre
  • 8,691
  • 16
  • 36