cron jobs environment variables
Hello,
My system is a Debian Sarge. The problem is that no matter what i do cron executes with the same environment setting every time.
SHELL=/bin/sh
PATH=/usr/bin:/bin
_=/usr/bin/env
PWD=/home/username
LANG=en_GB
HOME=/home/username
SHLVL=2
LANGUAGE=en_GB:en_US:en_GB:en
LOGNAME=username
It completely ignores ~/.bash_profile /etc/profile /etc/bash.bashrc
My shell script is linked to bash i.e. /bin/sh -> bash
I also tried editing the /etc/crontab to add the environment settings i wanted but it didnt work.
The aim was to use keychain to automate backup but although the scripts work fine from login they dont from cron because of the missing variables SSH_...
Nothing was mentioned about this in the documentation I followed and although many people have had similar problems the information is patchy.
The main question is,
Where to change environment variables for cron jobs?
Thank you for reading this post
Last edited by Alfar; 12-15-2006 at 12:49 PM.
|