Posts

Showing posts from March 10, 2019

Docker and cron environments

Image
-1 I have problem with environment variables in docker image.. I created file: /cron.sh #!/bin/bash whoami export When I run manual in console: sh /cron.sh is OK (root, full envs) but when I add command to cron that I getting: root, basic envs (not have my variables). Crontab -e: * * * * * /bin/bash /cron.sh > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1 Why are the differences? bash docker cron centos share | improve this question edited Nov 15 '18 at 12:32 George Appleton 615 4 27 asked Nov 15 &#