Computing.Net > Forums > Unix > ftp status

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

ftp status

Reply to Message Icon

Name: esam
Date: May 9, 2004 at 00:23:03 Pacific
OS: icl system V
CPU/Ram: sparc
Comment:

hellow evry body
i send files by ftp using ksh script . The real Proplem is How to Know if the sent file sent OK or Not (As rcp command I was check ($?) to know the sent file correctly sent or not)?
thanks
esam


E S A M



Sponsored Link
Ads by Google

Response Number 1
Name: Dlonra
Date: May 12, 2004 at 05:43:08 Pacific
Reply:

must use ftp command to test -e.g. ls


0

Response Number 2
Name: esam
Date: May 15, 2004 at 23:31:07 Pacific
Reply:

I realy used this solution inside my script ; But How I decide the result (Found OR NotFound )To report in simply and readable Form to enduser .To invoke this The following was my way :
1- call ftp scrpt from a parent scrpt
2- redirect ALL ftp output to a file
3- put the file
4- run "ls" inside ftp & echo a messge conaining constant expr. to the output file
5- after ftp scrpt ends , the process reback to parent scrpt then I grep a line witch includes both constant "IS" and the sent file name because I noticed that when ls found file it prints the file name .
but I want more proffisional way


clear

echo "enter date ..\c" ; read dte ; export dte
if [ $dte ] ; then
echo ".. SENDING ...\c"
# folowing line calls ftp scrpt i named it SEND
/home2/flexuser/report/send >/home2/flexuser/report/send.log 2>&1
echo "Branches NOT sent "
echo "=================="
grep IS /home2/flexuser/report/send.log |grep -v txt|cut -f8 -d" "
echo ""
echo "Branches didnot respond "
echo "=================="
grep respond /home2/flexuser/report/send.log
echo ""
echo "Branches sent "
echo "=================="
grep IS /home2/flexuser/report/send.log |grep txt |cut -f14 -d" "
else
echo "input is not proper "
exit 1
fi
echo " Press Enter To exit ..\c"
read xx


###FTP SEND SCRIPT ###############
for host in `cat /home2/flexuser/.netrc |cut -f2 -d" "`
do
brn=`grep $host /home2/flexuser/.netrc |cut -f8 -d " "`

ping $host 1 >/dev/null
case $? in
0)echo "\n Now you are sending $host";
ftp $host <<-ENDFTP
lcd /home2/flexuser/source
cd ATM_REP
put br_rp$dte.$brn br_rp$dte.$brn.txt
ls br_rp$dte.$brn.txt
!echo " IS The file br_rp$dte.$brn for $host Found ?\c"
bye
ENDFTP
;;
echo " No respond from $host" ;;" >> /home2/flexuser/report/send_rep/noconect ;
esac
done


E S A M


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


how to map the j drive Replace Word



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: ftp status

Ftp thru shell script www.computing.net/answers/unix/ftp-thru-shell-script/2313.html

ftp in shell script www.computing.net/answers/unix/ftp-in-shell-script/2318.html

Want info on FTP www.computing.net/answers/unix/want-info-on-ftp-/3104.html