AWS Elastic Beanstalk: Running Cron.d script, missing Environment Variables

前端 未结 9 1157
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 10:39

I\'m trying to run a PHP script that is triggered by a cron script (in cron.d). The script is triggered properly but it is missing the Elastic Beanstalk \"Environment Variab

9条回答
  •  时光说笑
    2021-01-17 11:12

    I added the following line to my shell script:

    source /opt/elasticbeanstalk/support/envvars .bash_profile
    

    So my script, which is executed by the crontab, looks like this:

    #!/bin/sh
    source /opt/elasticbeanstalk/support/envvars .bash_profile
    
    
    # do some php stuff
    

提交回复
热议问题