This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
/etc/profile not being executed by cron job
- From: Al Goodniss <amg at townisp dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 25 Sep 2003 12:14:17 -0400
- Subject: /etc/profile not being executed by cron job
- Reply-to: amg at townisp dot com
Hi,
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?
-Al
--- Test script ---
#!/usr/bin/bash
date
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
/c/WINDOWS/system32/find
-- /etc/profile --
PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
export PATH
USER="`id -un`"
# Set up USER's home directory
if [ -z "$HOME" ]; then
HOME="/home/$USER"
fi
if [ ! -d "$HOME" ]; then
mkdir -p "$HOME"
fi
export HOME USER
for i in /etc/profile.d/*.sh ; do
if [ -f $i ]; then
. $i
fi
done
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/