/etc/profile not being executed by cron job

Al Goodniss amg@townisp.com
Thu Sep 25 16:21:00 GMT 2003


Please point me to what I missed. I have a simple cron job doing backups using tar and find. Works flawlessly in an interactive shell. Cron also works fine for fetching mail, etc. The combination doesn't work. 

When I run my bash (tcsh also fails) script via Cron the wrong find is found. Instead of /usr/bin/find I get the windows version. My /etc/profile does prepend the directories, the permissions seen accurate - as per the other fixes that were in the archives. 

What did I miss? 


--- Test script ---


echo $PATH # reports only windows paths, no Cygwin
which find # Finds the win32 version

-- Results --
Thu Sep 25 12:08:00 EST 2003
/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/PROGRA~1/ULTRAE~1:/c/Program Files/Micros
oft SQL Server/80/Tools/Binn/:/bin

-- /etc/profile --
export PATH

USER="`id -un`"

# Set up USER's home directory
if [ -z "$HOME" ]; then

if [ ! -d "$HOME" ]; then
    mkdir -p "$HOME"

export HOME USER

for i in /etc/profile.d/*.sh ; do
    if [ -f $i ]; then
        . $i

export MAKE_MODE=unix
export PS1='\[\033]0;\w\007 \033[32m\]\u@\h \[\033[33m\w\033[0m\] $ '

cd "$HOME"

Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

More information about the Cygwin mailing list