Tom Reilly wrote:
Thanks for responding. I'm not to versed in Unix. Let me know what other information you need and I'll post it. So, you're saying at the top of my script, I should reference my profile? Would something like $HOME/.profile work?
You should post your script (using code tags) and the cron information. You cannot use $HOME/.profile because the .profile sets $HOME (its a chicken and egg thing :-)
Thanks Tom. Here's (basically) my script. I left out specific names and addresses. I tried putting ~/.profile at the very top. But, it still doesn't run. All that runs are the calls to startLog and endLog:
function startLog
{
echo "****************" >> logfile.log
echo "Started: `date`" >> logfile.log
echo "****************" >> logfile.log
}
function endLog
{
echo "****************" >> logfile.log
echo "Ended: `date`" >> logfile.log
echo "****************" >> logfile.log
}
startLog;
if [ -f dat.dat ]; then
echo "Found data file... >> logfile.log
while read -a line
do
if [ ! -d /tempdir ]; then
echo "Temp folder missing" >> logfile.log
mkdir /tempdir
fi
echo "Creating remote archive for " ${line[0]} >> logfile.log
zip -rq /tempdir/${line[1]} ${line[2]}
if [ -f /tempdir/${line[1]}; then
sftp -b thebatch 192.192.1.1
fi
done < dat.dat
else
echo "No data file" >> logfile.log
fi
endLog;