Re: [foxboro] FTP
- From: "Mark Dumond" <mdumond@xxxxxxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Mon, 14 Jan 2002 15:29:10 -0500
Here is an automated ftp script that we use.
It uses standard shell "here-docs" to feed stdin to the AW's ftp client.
To use it, (assuming you name the script "ftpFile"):
ftpFile <host> <ftpUsername> <ftpUserpass> <RemoteDir> <LocalFileFullPath>
Good Luck!
Mark Dumond
FeedForward, Inc
Control Systems Applications
1341 Canton Road, Suite H1
Marietta, GA 30066
770.426.4422
#!/bin/sh
#
# Script usage:
# ftpFile <Host> <HostUsrNm> <UserPass> <RemDir> <LocFileNameFullPath>
#
###############################################################
HOST="$1"
USER="$2"
PASS="$3"
DIR="$4"
LOCFILE="$5"
############################################################
# Ping host to make sure host is reachable
############################################################
ping $HOST >/dev/null
stat=$?
if [ "$stat" -ne 0 ] ; then
echo "ERROR - can not transfer file to $HOST"
echo "Can not Ping Host: $HOST"
exit 1
fi
############################################################
# Ftp "put" file to home dir on remote host
############################################################
REMFILE=`basename $LOCFILE`
ftp -n $HOST >/tmp/ftpErr.$$ <<EndFTP
ascii
user $USER $PASS
cd $DIR
put $LOCFILE $REMFILE
EndFTP
ERRORS=`cat /tmp/ftpErr.$$`
if [ $? -ne 0 -o ! -z "$ERRORS" ]
then
if [ ! "$ERRORS" = "Please login with USER and PASS." ] ; then
echo "ERROR - can not transfer file to $HOST"
cat /tmp/ftpErr.$$
rm -f /tmp/ftpErr.$$
exit 1
fi
fi
rm -f /tmp/ftpErr.$$
exit 0
-----Original Message-----
From: foxboro-bounce@xxxxxxxxxxxxx
[mailto:foxboro-bounce@xxxxxxxxxxxxx]On Behalf Of pharizna@xxxxxxxxxxxxx
Sent: Monday, January 14, 2002 2:48 PM
To: foxboro@xxxxxxxxxxxxx
Subject: Re: [foxboro] FTP
Thank you Rick but there is a problem: I'd like to send some IA files (AW50)
to an IIS (Windows'NT) system... Probably, I can't use rcp. Can I?
Thanks
Pedro Hernandez
REPSOL YPF Quimica
pharizna@xxxxxxxxxxxxx
-----Mensaje original-----
De: Rick de la Cierva [mailto:rcierva@xxxxxxxxxxxxxxxx]
Enviado el: lunes, 14 de enero de 2002 19:09
Para: foxboro@xxxxxxxxxxxxx
Asunto: Re: [foxboro] FTP
Pedro I assume you are on a 50 or 51 series IA machine, since you are
talking about crontab. Try using rcp instead of ftp since this is
easier. Just type in at the source machine:
rcp /opt/FILEFULLPATH LETTERBUGDEST:/DESTDIRCTORY
for example: rcp /opt/fox/ciocfg/sequeninclude/junk.inc
AW0051:/opt/fox/ciocfg/sequeninclude
This is much easier to run then ftp.
Rick de la Cierva
DLC SOLUTIONS CORP.
Phone: 203-207-9917
-----Original Message-----
From: pharizna@xxxxxxxxxxxxx [mailto:pharizna@xxxxxxxxxxxxx]=20
Sent: Monday, January 14, 2002 12:59 PM
To: Foxboro@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx; foxboro@xxxxxxxxxxxxx
Subject: [foxboro] FTP
Hi:
I'd like to send a file from our IA to another one every day at noon,
for
example.
I know that I can to use "cron" in order to automate the process but I
don't
know how to make an FTP in "auto mode" (without human intervention).
Could you help me?
Regards
Pedro Hernandez
REPSOL YPF Quimica
pharizna@xxxxxxxxxxxxx
=20
=20
___________________________________________________________________
This list is neither sponsored nor endorsed by The Foxboro Company.
Use the information obtained here at your own risk. For disclaimer,
see http://www.thecassandraproject.org/disclaimer.html#maillist
list info: http://www.freelists.org/list/foxboro
subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Djoin
unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Dleave
___________________________________________________________________
This list is neither sponsored nor endorsed by The Foxboro Company.
Use the information obtained here at your own risk. For disclaimer,
see http://www.thecassandraproject.org/disclaimer.html#maillist
list info: http://www.freelists.org/list/foxboro
subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
___________________________________________________________________
This list is neither sponsored nor endorsed by The Foxboro Company.
Use the information obtained here at your own risk. For disclaimer,
see http://www.thecassandraproject.org/disclaimer.html#maillist
list info: http://www.freelists.org/list/foxboro
subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
___________________________________________________________________
This list is neither sponsored nor endorsed by The Foxboro Company.
Use the information obtained here at your own risk. For disclaimer,
see http://www.thecassandraproject.org/disclaimer.html#maillist
list info: http://www.freelists.org/list/foxboro
subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
- References:
- Re: [foxboro] FTP
- From: pharizna
Other related posts:
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- » Re: [foxboro] FTP
- Re: [foxboro] FTP
- From: pharizna