Meike Stone writes:
As hinted in the last cited line:
the /etc/crontab is: ============================================== SHELL=/bin/bash ENV=/etc/profile.d/my-env.sh
If $SHELL is /bin/bash, $ENV is not read. Then $BASH_ENV is read.
Yes you are right. But I changed it to SHELL=/bin/sh and the same problem again. As you can see in my former posting, the variables are read (debug output from cron), but they are not set in the called cron (output from "set")
You are right that ENV doesn't work. I don't know why, according to the docs it should. The following works at my workstation: /etc/crontab: ============================================================ SHELL=/bin/bash PATH=/usr/bin:/usr/sbin:/sbin:/bin MAILTO=root BASH_ENV=/tmp/setenv.sh # # check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly # * * * * * root /tmp/tstvar.pl ============================================================ /tmp/setenv.sh: ============================================================ export DEMO=demo ============================================================ /tmp/tstvar.pl: ============================================================ #!/usr/bin/perl open STDOUT, '>>/tmp/tstvar.out'; print "perl ENV DEMO: $ENV{DEMO}\n"; exit(0); ============================================================ created output file /tmp/tstvar.out: ============================================================ perl ENV DEMO: demo perl ENV DEMO: demo perl ENV DEMO: demo ============================================================ one line per minute. I use Perl to test that the env var is set for all cron jobs and not just for shell scripts. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jschrod@acm.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org