Cron
Encrypt .env secrets for cron jobs with dotenvx and inject them securely at runtime.
Install
Get the Dotenvx CLI.
$ curl -sfS https://dotenvx.sh | sh
Encrypt
Encrypt your .env file.
$ dotenvx encrypt
Inject
Then inject your encrypted secrets in cron jobs with
dotenvx run.
# run every day at 8am
0 8 * * * dotenvx run -- /path/to/myscript.sh