Found an answer to my script issue:
Code:
upload=`find $local -newer $status -type f`
touch $status
if [ -z "$upload" ]; then
echo "Nothing to do...exiting"
exit
else
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for each in $upload; do
remote_dir=`echo "$each" | awk -F/ '{ print $6 }'`
echo -en "\n\nRemote Directory=$remote_dir"
echo -e "File Name=$each"
ncftpput -bb -u $username -p $passwd $host /$remote_dir "$each"
IFS=$SAVEIFS
done
fi
exit
By getting rid of the cmd1= part and replacing it directly with ncftput I didn't need the double quotes so I could then effectively use them around $each.
I'm trying to recursively upload only files that have changed in a directory. No changes = no upload. The thing I like about ncftpput is that you can set it up into a batch file. Then you can choose when you want to execute the upload via the command 'ncftpbatch'.
Haven't tried the lftp command but it looks like it has some cool applications as well. I'll have to explore that later now that I have a working script.
Thanks for all the useful input.