There's another option, which mitigates some of the maintenance issues of having variables set in all your scripts, yet doesn't require the environment to be altered for all cron jobs. That is to launch your cron jobs via some wrapper script which sets environment variables.
e.g. Make a script /home/me/cronrun containing:
Code:
export PATH="$PATH:/your/cron/path/extras"
export SOMEENV="somevalue you need"
"$@"
Be very careful about sourceing your shell init files (e.g. ~/.bashrc) that you don't end up spawning lots of shells, especially if you have a "tricked out" your shell init files. It'll probably be perfectly OK until some smart-arse makes a change and all your cron jobs stop working, or worse, jam up the system...
Once you've made such a script and chmodeed it to be executable, you can modify your cronjobs like this (addition in
blue):
Code:
0 * * * * /home/me/cronrun old_command arg arg