0

I have an issue : I add inside /etc/profile.d/proxy : export http_proxy=http://IP:80/ export https_proxy=http://IP:80/ export ftp_proxy=http://IP:80/ export no_proxy="localhost,127.0.0.1,localaddress,.domain.com" export HTTP_PROXY=http://IP:80/ export HTTPS_PROXY=http://IP:80/ export FTP_PROXY=http://IP:80/ export NO_PROXY="localhost,127.0.0.1,localaddress,.domain.com" Run source /etc/profile.d/proxy.sh Then :

  • run a script with /usr/bin/php /var/cron/script.php : perfect :)
  • add inside crontab -e : sudo /usr/bin/php /var/cron/supervision.php : nothing :(

According to how to add http_proxy automatically to new users in ubuntu server it should be enough. It was chmod 755 (root:root). My cron, as root, just refuse to use it.

2
  • AFAIK cron doesn't run jobs inside a login shell, so doesn't source /etc/profile (nor, by extension, *.sh files in /etc/profile.d/) Commented yesterday
  • I just put the proxy inside /etc/environment...problem solved.
    – Hab
    Commented 12 hours ago

0

You must log in to answer this question.

Browse other questions tagged .