The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
check if remote file exists hcclnoodles Shell Programming and Scripting 2 08-27-2008 02:53 PM
check if file exists in a mounted windows shared folder jul Shell Programming and Scripting 2 05-13-2008 10:50 PM
Check File Exists and compare to previous day file script rbknisely Shell Programming and Scripting 3 02-07-2008 08:53 AM
check if file exists on remote system ? hcclnoodles Shell Programming and Scripting 2 10-26-2006 01:08 AM
perl ftp check file exists methos Shell Programming and Scripting 2 06-18-2003 05:21 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-05-2005
Registered User
 

Join Date: May 2005
Posts: 48
check if exists a .ZIP file and unzip it using ftp

hi
this is my question
i have my script what have to verify the existence of a .ZIP file in a extern server (using ftp). if there are .ZIP files, the idea is what the script "unzip" them in the specified folder.

THE PROBLEM IS what the script doen´t unzip the .ZIP files, and besides, delete them (which is terrible).

please help me, i need to know what do i have to do to fix it.
this is the script:

#-----
# Verifica Existencia de Archivo en Servidor Externo
#--
VExiArc()
{
#--------------------------------------------------
# Verifica existencia de archivos ZIP y los descompacta
#--------------------------------------------------
ls ${DTMPINP}/*.zip > ${DTMPINP}/.zip.si
if [ -s "${DTMPINP}/.zip.si" ]; then
for uz in `ls ${DTMPINP}/*.zip`
do
unzip -l $uz|tail -3| head -1|read peso fecha hora nn
narc=`basename $uz`
wzip=".zip"
narc=${narc%%$wzip}
print $narc| awk '{print substr($0,1,8)"."substr($0,9,3)}'|read nok
if [ $nok = $nn ]; then
unzip -u -a -L -j $uz -d /sybase/DTMP/INP
else
nerr=$nn
echo $nok" "$nerr >> ${DTMPINP}/.ftp.nomarc.err
fi
rm $uz
narc=`basename $uz`
BorArc
done
fi
rm ${DTMPINP}/.zip.si



#--------------------------------------------------
# Verifica existencia de archivos en general
#--------------------------------------------------
ls ${DTMPINP}>${DTMPINP}/.ftp.nomarc

if [ -s "${DTMPINP}/.ftp.nomarc" ]; then
EXISTE=$TRUE
fi
}
#-----
Reply With Quote
Forum Sponsor
  #2  
Old 05-05-2005
Registered User
 

Join Date: Mar 2005
Posts: 64
unzip must be available on the server, in the chroot ftp directory.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0