Solved

ftp question

Posted on 2014-04-23
2
232 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
Comment Utility
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
Comment Utility
Sorry, there is typo in the script. Change

ftp prexfer.event.ibm.com < END

to

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now