Solved

ftp question

Posted on 2014-04-23
2
242 Views
Last Modified: 2014-05-07
Hi,
I have to ftp from one machine to another machine

1) on aa under /user/dev i have file aa.ixf

2) i want to ftp aa.ixf to  xfer@prexfer.event.ibm.com:/db2_database/db2extracts

how can i do it do i need user is password for no 2)
0
Comment
Question by:sam2929
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 40019270
Hi,

You may use ftp within a script to transfer files.

To automate ftp within a script, use .netrc file in the user's home directory (the one who will run the script on aa). Run command:

cd

The .netrc file should not be readable by others i.e. use

chmod 400 .netrc

The entry in .netrc should be as below:

machine myftpserver
login remoteusername
password mypassword

myftpserver is the server which is the ftp server where you want to sent the file(s). It is prexfer.event.ibm.com in your case.

remoteusername is the remote user login name on the ftp server. It is xfer in your case.

mypassword is the password of the remote user on the ftp server

for more info about .netrc, please use man netrc

- The script is similar to:

cd /user/dev
ftp prexfer.event.ibm.com < END
cd /db2_database/db2extracts
text
put aa.ixf
END

If the file is binary file, then change text above to binary

Run the script
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 40019272
Sorry, there is typo in the script. Change

ftp prexfer.event.ibm.com < END

to

ftp prexfer.event.ibm.com << END
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASA NAT rule change 3 83
HP Storage and Cisco Nexus 4 71
Esxi host upgrade 16 96
Basic nexus configuraton 11 19
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question