Sponsored Content
Full Discussion: Massive ftp
Top Forums Shell Programming and Scripting Massive ftp Post 303031174 by tricampeon81 on Friday 22nd of February 2019 10:55:48 AM
Old 02-22-2019
look how the code is at the end.
just can not just make a call to ftp, I had to put it inside a while

Code:
ORA_LOGIN=Fyyyyyyyy
ORA_PASSWORD=Fxxxxxxx
ORACLE_SID=PBSEGD
export ORA_LOGIN
export ORA_PASSWORD
export ORACLE_SIDA
FchInput=$1
TmpArch="AbonoTmp_"
TmpExt=".Tmp"
FILTRO="AbonoTmp_20190222.Tmp"

#HOST
HOST="192.168.80.15"
USER="Fxxxxxxx"
PASSWD="Fyyyyyyy"

echo "Inicio Proceso cesantia por favor espere...." > receparchcta_$fecha.log

#ini nombre archivo
# Ini rescato lista de nombre de archivos

cat << EOF | sqlplus -s  ${ORA_LOGIN}/${ORA_PASSWORD}@${ORACLE_SID} > AbonoTmp_$FchInput.Tmp
    set feedback off
    set echo OFF
    set sqlnumber off
    set serveroutput on size unlimited
    set trimout off
    set trimspool off
        DECLARE
           RC1             fidensctrl.globalPkg.RCT1;
        BEGIN

                SP_SIN_GNRARCHABOCTARSAT (6,'$FchInput',1,1,RC1);
         END;
/
exit;
EOF
#fin nombre archivo

ARCHCES=$TmpArch$FchInput$TmpExt
echo "NOMBRE DE ARCHIVO:" $ARCHCES >> receparchcta_$fecha.log

#while read line; do
#echo  "$line"; 

#done < $ARCHCES

#exit 88


#para archivo cesantia
if [ -f $ARCHCES ];
then
  
   echo "existen registro, para Archivo cesantia:" $ARCHCES >> receparchcta_$fecha.log
   total=`wc -l $ARCHCES | cut -c1-8`
   echo "Cantidad de Registro:" $total >> receparchcta_$fecha.log

   if [ $total -ne 0 ]; 
   then
      echo "existen registro, para Archivo :" >> receparchcta_$fecha.log
      #ini ejecuto FTp tantas veces archivos existan

while read line; do
      
       echo 'open '$HOST''               >  mc_comando2.lst
       echo 'user '$USER' '$PASSWD''     >> mc_comando2.lst    
       echo 'prompt off'                 >> mc_comando2.lst
       echo 'mput '$line''               >> mc_comando2.lst
       echo 'close'                      >> mc_comando2.lst
       echo 'bye'                        >> mc_comando2.lst
       ftp -n < mc_comando2.lst  >> receparchcta_$fecha.log
       echo 'VERIFICANDO EL ENVIO.....' ? >> receparchcta_$fecha.log

      
        
       #fin actualizo archivo
    
      done < $ARCHCES
   else
      echo "NO existen registro, para Archivo :" >> receparchcta_$fecha.log
   fi
else

echo "No existen registro,para archivo cesantia: " $ARCHCES >> receparchcta_$fecha.log

fi


 #ini actualizado archivo
        cat << EOF | sqlplus -s  ${ORA_LOGIN}/${ORA_PASSWORD}@${ORACLE_SID} >> receparchcta_$fecha.log
            set feedback off
            set echo OFF
            set sqlnumber off
            set serveroutput on size unlimited
            set trimout off
            set trimspool off
                DECLARE
                   RC1             fidensctrl.globalPkg.RCT1;
                BEGIN

                        SP_SIN_GNRARCHABOCTARSAT (7,'$FchInput',1,1,RC1);
                 END;
        /
        exit;
        EOF


rm -f mc_comando2.lst
rm -f AbonoTmp_$FchInput.Tmp
exit 0

it works perfect to send multiple file but I did not like having to put the FTP inside a while

Last edited by RudiC; 02-22-2019 at 12:30 PM.. Reason: Obfuscated authentication info
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Send a massive message to the connected users

How can I send a message for all the users connected into the system at the same time? Let's say I need to reboot the server and I ask the users to save their jobs becasue the server will be rebooted? (5 Replies)
Discussion started by: agasamapetilon
5 Replies

2. UNIX for Advanced & Expert Users

Solution for the Massive Comparison Operation

Hi We have 50 million records in mainframes DB2. We have a requirement to Record the Change Data Capture(CDC) records. i.e New Records or Updated Records that were added into the DB2. Unfortunately we dont have any column indicators to give the details of the changes made to the records. ... (8 Replies)
Discussion started by: raghav288
8 Replies

3. UNIX for Dummies Questions & Answers

massive tarred grib files totally unacceptable

Hi, I have 7 terabytes of tar files, one for every single day since 1980. Inside these tar files are GRIB files, each with 100+ variables. There's 8 GRIBs in each tar, corresponding to different times of the day. I need 6 friggin variables..., and it takes TWO WEEKS TO EXTRACT ALL THE TAR FILES... (3 Replies)
Discussion started by: sammysoil
3 Replies

4. Shell Programming and Scripting

Unix Shell basic loop massive n00b

hey guys I would really appreciate some help, i need to do a project for a job that requires minimal UNIX scripting and im REALLY stuck basically Im stuck at what i believe is something really simple but i just dont have a clue how to do it efficiently and properly and i REALLY appreciate some... (16 Replies)
Discussion started by: thurft
16 Replies

5. Homework & Coursework Questions

having massive trouble with 5 questions about egrep!

Hi all! I need help to do a few things with a .txt file using egrep. 1. I need to list all sequences where the vowel letters 'a, e, i, o, u' occur in that order, possibly separated by characters other than a, e, i, o, u; consisting of one or more complete words, possibly including punctuation. ... (1 Reply)
Discussion started by: dindiqotu
1 Replies

6. Shell Programming and Scripting

Massive Copy With Base Directory

I have a script that I am using to copy around 40-70k files to a NFS NAS. I have posted my code below in hopes that someone can help me figure out a faster way of achieving this. At the end of the script i need to have all the files in the list, copied over to the nas with source directory... (8 Replies)
Discussion started by: nitrobass24
8 Replies

7. Solaris

Solaris 10 massive SMF log file

I found that there was a SMF log file: /var/svc/log/milestone-multi-user-server:default.log.0 which occupied around 19G bytes. Please help me how to purge this massive file. Can I just use cat /dev/null > /var/svc/log/milesto..... to this file without any interruption to a non-stop system?... (11 Replies)
Discussion started by: AlexLi
11 Replies
ftp(4)								   File Formats 							    ftp(4)

NAME
ftp - FTP client configuration file SYNOPSIS
/etc/default/ftp DESCRIPTION
Use the ftp file to configure the behavior of the FTP client. Lines that begin with a hash symbol ("# ") are treated as comment lines and are ignored. Behavior Directives The ftp file supports the following behavior directives: FTP_LS_SENDS_NLST=yes | no The ls command of the ftp client sends an NLST to the FTP Server by default. Several non-Solaris clients send LIST instead. In order to make the Solaris ftp client send LIST when the ls command is issued, set FTP_LS_SENDS_NLST to no. The value of FTP_LS_SENDS_NLST is yes by default. If the user sets a value for FTP_LS_SENDS_NLST in the user's environment, this value will override any FTP_LS_SENDS_NLST directive that is specified in /etc/default/ftp. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbipr | +-----------------------------+-----------------------------+ SEE ALSO
ftp(1), attributes(5) SunOS 5.10 22 Oct 2002 ftp(4)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy