Forums

How can I set an environment variable that would be available to a scheduled task ?

Thank you.

Hmm. I think the best thing to do would be to write a shell script wrapper.

For example, if you have a task that needs to run a Python script /home/khalilelkouhen/my_script.py then you'd write a script /home/khalilelkouhen/my_script.sh with the contents

export FOO=hello
python /home/khalilelkouhen/my_script.py

...then set the execute permission on the shell script (chmod +x my_script.sh in a bash console) and schedule the shell script.

Ok thanks.