Hi,
I wrote a peice of shell script to trasfer files via ftp but if the ftp fails to connect i need to error out the concurrent program can anyone give the peice code for this requirement
my code:
#LOCALDIR=/tmp
REMOTESERVER=198.140.146.14
#REMOTEPATH=/inbound
#LOGIN=genpak
#PASSWORD=e3cltvEAdO
cd /tmp
#find . -type f -mtime 0
for i in *
do
if [ -s $i ]; then
echo "$i is a file and size is greater than zero."
else
echo "$i is an empty file and deleting now..."
rm -rf $i
fi
done;
echo $1 $2 $3
#if [! -f $REMOTESERVER ]
#then
#echo “Entered Exception”
#exit 1
#else
#exit 0
#fi
ftp -n $REMOTESERVER<<INPUT_END
prompt off
quote user resonance
quote pass resonance
prompt off
cd /orap/01/app/resonance/dinesh
mput *.*
quit
INPUT_END;
please let me know the anser as soon as possible