I want to read a env variable in crontab.
I tried with run printenv from crontab and it runs fine:
* * * * * BASH_ENV=/etc/profile bash -c "printenv CNE_CLUSTER_NAME >> output.txt"
I need to run a job with some operation performed by python's script. I sheduled it in crontab like this:
* * * * * BASH_ENV=/etc/profile bash -c "/usr/bin/python3 /var/cne/cluster/$(echo $(printenv CNE_CLUSTER_NAME))/scripts/setup/job.py"
But when running from crontab is var CNE_CLUSTER_NAME is empty
python3: can't open file '/var/cne/cluster//scripts/setup/job.py': [Errno 2] No such file or directory)
So, how can i do to read variable or replaced the values's variable in the string ? Please.