Where can I set environment variables that crontab will use?

I have a crontab running every hour. The user running it has environment variabless in the .bash_profile that work when the user runs the job from the terminal, however, obviously these don’t get picked up by crontab when it runs.

I’ve tried setting them in .profile and .bashrc but they still don’t seem to get picked up. Does anyone know where I can put environment vars that crontab can pick up?

20 Answers
20

Leave a Comment