Massive ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Massive ftp
# 1  
Old 02-20-2019
Massive ftp

friends

good morning

FTP works perfect but I have a doubt

if I want to transport 10 files, I imagine that I should not open 10 connections as I can transfer more than 1 file?



Code:
ftp -n <<!EOF
open caburga
user ephfact ephfact
cd /users/efactura/docONE/entrada
bin
mput EPH`date +%Y%m%d`XXFF_cc_01.REC  EPH`date +%Y%m%d`XXFF_cc_01.CTR
quit
!EOF

# 2  
Old 02-20-2019
Quote:
Originally Posted by tricampeon81
friends

good morning

FTP works perfect but I have a doubt

if I want to transport 10 files, I imagine that I should not open 10 connections as I can transfer more than 1 file?



Code:
ftp -n <<!EOF
open caburga
user ephfact ephfact
cd /users/efactura/docONE/entrada
bin
mput EPH`date +%Y%m%d`XXFF_cc_01.REC  EPH`date +%Y%m%d`XXFF_cc_01.CTR
quit
!EOF

Just transfer all files on the same connection. use
Code:
mput EPH`date +%Y%m%d`*.REC  EPH`date +%Y%m%d`*.CTR

If the number is all that changes in the 'XXFF_CC_01' part

FTP Multiple Files
This User Gave Thanks to steveo314 For This Post:
# 3  
Old 02-20-2019
ftp

what happens is that I have a list of files and that list I must pass to the connection and send the files for example

file_1.tmp content

Code:
test1.txt
test2.txt
test3.txt


and each of them are files that I have to send, that list is dynamic


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by vgersh99; 02-20-2019 at 05:19 PM..
# 4  
Old 02-20-2019
Code:
cat <<!EOF
open caburga
user ephfact ephfact
cd /users/efactura/docONE/entrada
bin
mput EPH`date +%Y%m%d`XXFF_cc_01.REC  EPH`date +%Y%m%d`XXFF_cc_01.CTR
`xargs printf "put %s" < file_1.tmp"`
quit
!EOF

This won't connect to FTP, just print the commands to console, for you to check that it's what you wanted. It ought to add a put filename for every file in your file_1.tmp

Once you're sure it looks right, replace cat with ftp -n.
# 5  
Old 02-20-2019
Small adaption to Corona688's proposal as mput accepts multiple file names for its parameters:



Code:
cat <<EOF
open caburga
user ephfact ephfact
cd /users/efactura/docONE/entrada
bin
mput EPH$(date +%Y%m%d)XXFF_cc_01.REC  EPH$(date +%Y%m%d)XXFF_cc_01.CTR
mput $(tr $'\n' ' ' < file_1.tmp)
quit
 EOF


EDIT: Or even

Code:
mput EPH$(date +%Y%m%d)XXFF_cc_01.REC  EPH$(date +%Y%m%d)XXFF_cc_01.CTR $(tr $'\n' ' ' < file_1.tmp)


Last edited by RudiC; 02-20-2019 at 05:46 PM..
These 2 Users Gave Thanks to RudiC For This Post:
# 6  
Old 02-21-2019
ftp

hello good afternoon friend

I really could not solve this problem, what I understand is that I must do this

Code:
cat <<!EOF
open caburga
user ephfact ephfact
cd /users/efactura/docONE/entrada
bin
mput < file_1.tmp"`
quit
!EOF

# 7  
Old 02-21-2019
What?
What keeps you from adapting your code from post #1 using one of the proposals given as a guide?
This User 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