![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 } #----- |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
unzip must be available on the server, in the chroot ftp directory.
|
|||
| Google The UNIX and Linux Forums |