ftp files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ftp files
# 1  
Old 05-04-2009
ftp files

Dear ALL

i had a file name called test.log witch contains 300 archives log files.

so how can i give the test.log as a input to the ftp script

please let me know

Thank you
# 2  
Old 05-04-2009
cat test.log

test_1_7204_634221381.arc
test_1_7205_634221381.arc
test_1_7206_634221381.arc
test_1_7207_634221381.arc
test_1_7208_634221381.arc
test_1_7209_634221381.arc
test_1_7210_634221381.arc
test_1_7211_634221381.arc
test_1_7212_634221381.arc
test_1_7213_634221381.arc
test_1_7214_634221381.arc
test_1_7215_634221381.arc
test_1_7216_634221381.arc
test_1_7217_634221381.arc
test_1_7218_634221381.arc
test_1_7219_634221381.arc
test_1_7220_634221381.arc
test_1_7221_634221381.arc
test_1_7222_634221381.arc
test_1_7223_634221381.arc
test_1_7224_634221381.arc
test_1_7225_634221381.arc
test_1_7226_634221381.arc
test_1_7227_634221381.arc
test_1_7228_634221381.arc
test_1_7229_634221381.arc
test_1_7230_634221381.arc
test_1_7231_634221381.arc
test_1_7232_634221381.arc
test_1_7233_634221381.arc
test_1_7234_634221381.arc
test_1_7235_634221381.arc
test_1_7236_634221381.arc
test_1_7237_634221381.arc
test_1_7238_634221381.arc
# 3  
Old 05-04-2009
Try This...
Your file will be ftpied as a regular file,even if contains 300 files.
Better zip it and ftp.but if you are zipping then send in binary mode.
read $filename
ftp -inv $IPADDRESS << EOF
user $username $pass
mput $filename
bye
# 4  
Old 05-04-2009
Also Try This,It will take one by one file and ftp them.
It may require some modification this is just a logic
while IFS= read -r line
do
ftp IPADDRESS
put $line
bye
done < test.log
# 5  
Old 05-04-2009
Hi manish

Thank you for ur update

can you please provide the exact logic

to give each filename as input.

this is really in need for me

Thank you
# 6  
Old 05-04-2009
The previous logic will pick files from test.log,you need not to specify filenames one by one manually.It will read line by line from test.log and ftp them ..
while IFS= read -r line
do
ftp IPADDRESS
put $line
bye
done < test.log # I am providing input as test.log
# 7  
Old 05-04-2009
Hi

I had modified the script but i am getting as


username="oracle"
password="test4321"
while IFS= read -r line
do
ftp 172.22.32.48 <<EOF
quote USER $username
quote PASS $password
put $line
bye
done < test.log
EOF

pls suggest if tis is correct and the error i am getting is

test.sh: syntax error at line 13: `end of file' unexpected

Thank you
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. Shell Programming and Scripting

Need help creating a script to FTP files to a server and then delete the files that were transfered.

I am trying to FTP files to a Windows server through my Linux machine. I have setup the file transfer with no problems but am having problem deleting those files from the Linux box. My current non-working solution is below. Any ideas, anyone?? :wall: Please be gentle, I'm fairly new to this... (4 Replies)
Discussion started by: jmalfhs
4 Replies

3. Shell Programming and Scripting

ftp files ...

Hi , I am new to shell scripting I was planning to write a script that will FTP files to destination folder..so which approach should I follow the ftp one or sftp one or scp one and which one one of them is most secure and fastest one..? (1 Reply)
Discussion started by: rahul125
1 Replies

4. Shell Programming and Scripting

getting only new files from FTP

iam using mget *.* too get all files in FTP iam checking the FTP Server every day for the new files(there are 100s every day) and iam doing *.* by doing so iam getting the old files also(it overwriting the old files) ...... how can i get only the new files...... from FTP (4 Replies)
Discussion started by: nani1984
4 Replies

5. Shell Programming and Scripting

FTP the files

Hi, Currenty I am transfering the files which are in list-test.txt. Below is the code for same - file_ftp () { while read inFile do #inFile=abc.arch.gz FILETYPE=$inFile ftp -in $GATEWAY1 <<! user $USERID1 $PASSWD1 lcd $PICKUPDIR cd $DROPDIR1 bin ... (1 Reply)
Discussion started by: ravigupta2u
1 Replies

6. Shell Programming and Scripting

FTP files

Hi, I have to transfer the files from one unix box to abnother. Below is the function i have written - file_ftp () { #for inFile in `cat /home/rgupta/list-test.txt` #do inFile=abc.arch.gz FILETYPE=$inFile ftp -in $GATEWAY1 <<! user $USERID1 $PASSWD1 ... (3 Replies)
Discussion started by: ravigupta2u
3 Replies

7. Filesystems, Disks and Memory

Not able to FTP the files to a FTP server

Hi , We are facing a weird problem in our project. we need to send some xml & audio files to a remote FTP server from a Linux box, we are doing this in Perl script using Net::FTP->. Issue here is.. when FTPed the files using Perl scripts, only empty files ( 0 byte) are getting created on the... (2 Replies)
Discussion started by: kishorepotta
2 Replies

8. Shell Programming and Scripting

Ftp too many files.

Hi folks, Small but interesting issue. I have 15 files in a directory with the same name as discribd below. refresh_20090407045220.dat refresh_20090407051445.dat refresh_20090407052138.dat refresh_20090407064528.dat refresh_20090407064654.dat refresh_20090407065012.dat... (9 Replies)
Discussion started by: Haque123
9 Replies

9. Shell Programming and Scripting

FTP of files

Hi all, I had written the following script to transfer the files thru FTP. But it throws me some error after I run the program. I guess its throwing error because of the path. Do help me. Thanks cd /home/psv find . -name '*.ksh' -print > /home/psv/ftpbatch/onefile cd... (2 Replies)
Discussion started by: mahalakshmi
2 Replies

10. UNIX for Dummies Questions & Answers

FTP files

Hi, I am new to unix and I want to ftp files from unix to windows nt machine. My requirement is like i want to ftp files which are having system date (20050927) in between the filename. Once i get into ftp mode, I am not able to execute the unix command the get the system date and to change it... (1 Reply)
Discussion started by: gopskrish
1 Replies
Login or Register to Ask a Question