Massive ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Massive ftp
# 15  
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
# 16  
Old 02-22-2019
As promised, thread locked. We cannot help you without feedback.
These 2 Users Gave Thanks to Corona688 For This Post:
# 17  
Old 02-22-2019
Please, please, have mercy with us!
Please, please, give us some reliable, consistent data to build upon.



Where in that code do we find your code snippet from post #1, and where file_1.tmp from post #3? Where do we find your attempts to include / adapt the proposals you received? How do you expect anybody to deal with those moving targets and to guess what be the input file and its structure?
These 2 Users Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

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. 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

6. 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

7. 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
Login or Register to Ask a Question