We have a set of environment variables being exported from an .envrc file within a dir. In the shell you can run direnv allow and the .envrc file gets invoked, thus creating the env vars.
We would like to have this same functionality when running a script with a crontab job, but the envrc file never runs.
We have tried:
- In crontab:
* * * * . $HOME/.profile; some/script/to/run - In script:
direnv allow- OR
- In script:
eval "$(direnv export bash)"
None of that works, is there a way to run the .envrc file from a script invoked by a cron job?