0

when I run some sh file using crone. they did not recognized certain command line.
like Pyenv command.

*****  /home/ammt/apps/crawler/scripts/bat_start.sh 

but it work fine when I type the whole thing after I log in to the Linux
in what situation it does not recognize some command line?


if you need more setting information let me know

min moica
  • 139
  • 2
  • 12
  • The environment can be different in a cron job versus your normal interactive shell...in this case, it sounds like your $path might be different. You could edit the script to source your .bashrc, .bash_profile, .login etc. to give you the same environment you get in an interactive shell, or provide absolute pathnames to Pyenv or other tools that may not be on the default $path you get in the cron environment. – Jim Lewis Sep 22 '17 at 00:14
  • 1
    Possible duplicate of [How to get CRON to call in the correct PATHs](https://stackoverflow.com/questions/2388087/how-to-get-cron-to-call-in-the-correct-paths) – Jim Lewis Sep 22 '17 at 00:18

0 Answers0