FTPying files from one sever to another server but into specified file.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTPying files from one sever to another server but into specified file.
# 1  
Old 04-13-2011
FTPying files from one sever to another server but into specified file.

Hi Friends,

My requirement is - I have to FTP a list of files from one server to another sever. I am using following code :
Code:
ftp -i -n << EOF >> abc.txt
open $COM_FTP_RHOST
user $COM_FTP_USER $COM_FTP_PASSWORD
cd $COM_FTP_PATH ( some folder )
ls -ltr filename*
bye
EOF

After FTPying, the files should be availble in abc.txt file.


Thanks
Sreekanth.

Moderator's Comments:
Mod Comment Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.

Last edited by zaxxon; 04-13-2011 at 04:49 AM.. Reason: code tags
# 2  
Old 04-13-2011
Code:
while read filename
do
ftp -i -n << EOF
 open $COM_FTP_RHOST
 user $COM_FTP_USER $COM_FTP_PASSWORD
 cd $COM_FTP_PATH 
 put $filename
 bye
EOF

done < abc.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

LAMP Sever

How do I install a LAMP server on a new installation of Debian 9 using the lalest versions of AMP? Here is what I have. Corrections please. MYSQL apt-get install mysql-server mysql-client You can verify the MySQL server status using command: systemctl status mysql ------- PHP7... (0 Replies)
Discussion started by: Meow613
0 Replies

2. BSD

Ping remote sever, nc, telnet, whatever

I put this thread to shell and bsd, because I want to resolve this matter on bsd. May somebody can explain to me how to ping a remote server, in unix. BTW the following code examples were tried on a linux system as well, with the same output, nothing. But on my bsd are not installed nmap neither... (4 Replies)
Discussion started by: 1in10
4 Replies

3. Shell Programming and Scripting

Need to Take Sent Mail Backup in Linux Sever

Everyday my code will send 100's* of mails from linux server to outlook using*sendmail command . I need to take a backup of those mails which are exactly sent from my linux server. This is needed for backup purpose. backuplocation is my local home dir.Is it possible to do this. I dont have root... (4 Replies)
Discussion started by: mohanalakshmi
4 Replies

4. Shell Programming and Scripting

SFTP files to a file server.

Hi, I am looking for a shell script to sftp to a file server and copy all the files from a directory after the script is run. The server name should be a user input parameter and of-course the username/password as well. Rest all should be handled by the script. I tried with below... (3 Replies)
Discussion started by: happysingh
3 Replies

5. Shell Programming and Scripting

Compare file in other sever

Hi All, I have totally two server. First server name is ABC which contains the file name is Sum.txt and Second server name is Sun here one file generate during the runtime. Currently I am in First Server. Now, I need to compare the server one file (Sum.txt) with server two file. If it... (2 Replies)
Discussion started by: suresh01_apk
2 Replies

6. Shell Programming and Scripting

script for to take files from FTP server to UNIX server and Unzipped that files

script for to take files from FTP server to UNIX server and Unzipped that files (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

7. Shell Programming and Scripting

Need shell script for ftpying multiple files

Hi All, I am a beginner for shell programming. I have a requirement to ftp multiple files. Here are the details. I have around thiry files in one directory, I want a shell script which selects 5 files at a time and does ftp them to another host . After the transfer for first files is... (0 Replies)
Discussion started by: srikanthn
0 Replies

8. AIX

Problem in ftpying the datasets containing comp values to AIX from mainframe

Hi, When i am trying to ftp COBOL generated data sets which contain comp values to AIX in ASCII mode. the comp values are getting corrupted. If i ftp the data set in binary mode it is working properly, but for this i have to change some compiler options in the COBOL. Also if i want to use the... (5 Replies)
Discussion started by: sekhar gajjala
5 Replies

9. AIX

find the IP's on the sever

Hi , I am working on AIx server which is connected to another network which is a stock market via leased line , From my side I connect to the server locally but what i need is to know the ip whic the server connect to the stock market how I can Know this ???? Thanks (1 Reply)
Discussion started by: habuzahra
1 Replies

10. Shell Programming and Scripting

Running a script on a different Sever

Guys, I want to run a script located on a different server from my pc. Let say the server has an IP of 1.1.10.2/16 and the script path is: /home/user/bin/check.sh The script scans for all available devices on the lan. My pc has an IP of 1.1.15.4/16 and I can ping the sever and can... (3 Replies)
Discussion started by: tony3101
3 Replies
Login or Register to Ask a Question