The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 05:53 PM
check if file exists in a mounted windows shared folder jul Shell Programming and Scripting 2 05-14-2008 01:50 AM
Check File Exists and compare to previous day file script rbknisely Shell Programming and Scripting 3 02-07-2008 11:53 AM
check if file exists on remote system ? hcclnoodles Shell Programming and Scripting 2 10-26-2006 04:08 AM
perl ftp check file exists methos Shell Programming and Scripting 2 06-18-2003 08:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-05-2005
DebianJ DebianJ is offline
Registered User
  
 

Join Date: May 2005
Posts: 52
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
}
#-----
  #2 (permalink)  
Old 05-05-2005
jolok jolok is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 64
unzip must be available on the server, in the chroot ftp directory.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0