Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp scripting ? needs help

Status
Not open for further replies.

alexia32

Technical User
Jul 31, 2007
156
NZ
Hi,
I have to create a script using a user ftp from my aix that will put some files on another system.
Ho to run a ftp command on script reading the files .netrc that contains login and passwd?
I never did it if someone can give me an example.
thanks
Al
 
Take a look at expect & autoexpect

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Code:
man netrc
is very helpful

Ceci n'est pas une signature
Columb Healy
 
When you say "never done this", do you mean never used .netrc, or never done an FTP script. If the latter, I suggest you get a simple script wokring first. It is is easy because you can do all the coimmands manually to verify they work and simply put them in a script on by one.

If the former and you just need to understand the .netrc file, then you should have man pages on netrc or search the web.

Example .netrc:
machine myserver login myuserid password mypassword

You have a command and value. You would simply replace the my values with your actual login info. The machine has to be listed in your /etc/hosts file.
 
Security practices says not to use FTP and .netrc it is better to use SCP with RSA keys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top