?
Solved

ftp question

Posted on 2014-04-23
2
Medium Priority
?
249 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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
This program is used to assist in finding and resolving common problems with wireless connections.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 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