How to get CRON to call in the correct PATHs

前端 未结 15 1151
时光取名叫无心
时光取名叫无心 2020-11-22 06:07

I\'m trying to get cron to call in the correct PATHs. When I run a Python script from shell the script runs fine as it uses the PATHs set in bashrc but when I use cron all t

15条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 06:55

    On my AIX cron picks up it's environmental variables from /etc/environment ignoring what is set in the .profile.

    Edit: I also checked out a couple of Linux boxes of various ages and these appear to have this file as well, so this is likely not AIX specific.

    I checked this using joemaller's cron suggestion and checking the output before and after editing the PATH variable in /etc/environment.

提交回复
热议问题