ftp exitcode
Hans-Joachim Hoetger
Hans-Joachim.Hoetger at telefonica.de
Thu May 13 18:04:07 CEST 2004
Moin,
ich habe hier eine kleine shellfunktion, die mir Logdaten per ftp
verschiebt. Dummerweise bekomme ich nicht mit, wenn die Verbindung zum
ftp-server nicht klappt weil ich irgendwie nicht an den exitcode des
ftpservers rankomme. Ich möchte aber eine Warnung verschicken, wenn das
ftp nicht geklappt hat. Hat dazu jemand eine Idee?
ftpit ()
{
# this function because the XXXXXX Mailserver rejects mails
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#
# call me with parameters: <server> <id> <password> <localname> <remotename>
# <localname> is expected NOT to be an archive. It will be packed by 'gzip -9'
# and remotely stored with the name <remotename>
#
# example:
# ftpit ftp.mediaways.net ufa secret rum rum-08.08.2001.gz
#
FTPSERVER="$1"
FTPUSER=$2
FTPPASS=$3
FTPFILE=$4
FTPREMOTENAME=$5
ftp -n -v ${FTPSERVER} >/dev/null <<+here
user ${FTPUSER} ${FTPPASS}
bin
put "| ${ZIP} -c -9 ${FTPFILE}" ${FTPREMOTENAME}
quit
+here
}
Best regards
--
Hans-Joachim Hoetger voice: +49-5246-80-1555
Telefónica Deutschland GmbH fax: +49-5246-80-2555
"And I certainly support good, readable docs, but in the
end the documentation is in the code." Steve Holmes (1999)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
URL: <http://lug-owl.de/pipermail/linux/attachments/20040513/45fbf1f7/attachment.sig>
More information about the Linux
mailing list