I use cron for years now. In order to load all my environment variables at once, I define them in a dedicated file (often but not always .bashrc) that I source in the crontab:
* * * * * (. /home/me/my_environment_variables.sh; my_script.sh)
Unfortunately, this trick fails to work with the debian wheezy server I've been recently asked to move to. More specifically, all happens as if the source command was ignored: my_script.sh is executed but with empty environment variable so that the results of the script are not the expected ones. I really don't understand the issue. Everything was perfectly working on my ubuntu
The installed cron package is "3.0pl1-124".
Have you any idea how to solve or to bypass this issue?
PS : Defining environmental variables in this way seems to work :
* * * * * (export OPTOS_HOME=/home/me/src/optos; my_script.sh)
However, defining more than one environment variables in this way is not convenient.