Solved

ftp question

Posted on 2014-04-23
2
236 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
  • 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Let’s list some of the technologies that enable smooth teleworking. 
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

770 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