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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP from AS400 to AIX using Linux ftpserver

Status
Not open for further replies.

jneal1998

MIS
Oct 30, 2000
4
US
Hi all,

I need to ftp files from an AS400 machine to an AIX server using a Linux ftp server. I have seen scripts that automate this from one unix box directly to another. However, with a Linux ftp server in the middle, how do I accomplish this? I assume that there special considerations for the AS400 ...?

I anticipate running the script through cron.

Thanks
 
May I ask why you are trying to run it throught he linux server and not directly FTP to the AIX server from the AS400?? Otherwise what you are going to have to do is FTP to the Linux Server then FTP the files from there to the AIX server, unless somebody has a creative way for doing it at one shot...
 
The Linux server is supposed to log the transfers to create some kind of record-keeping. What you suggest is exactly what I had to do. I have one script that ftp's the files from the AS400 and calls another to "put" the files onto the AIX server if finds any files in the download directory. I have tested them and they work.

The problem I have now is that I need to change owner of the files to root once they're on AIX. The script has to be supplied with the username and password in order to automate the transfer. I used a regular username and password to ftp the files since I can't put the root uname and password in a ascii ftp script. Question: once the files are on AIX, and from the script on the Linux box, is there a way to automate " chmod 755 * " and " chown root:system * " without compromising root. Right now, I have to manually log in to AIX to do this after the files have been transferred. Eventually, this script will be run through cron to get and put files - if any are present.

I guess one way is to have a cron job on AIX run every 5-10 minutes that does a "chmod" and "chown" on the directory. Maybe there's a more efficient way of doing this?
 
Not to make you rewrite and retest everything, but I think I agree with FrankAIX. You are having to ftp files twice, just for some record keeping that I would think the AS400 would be able to do when it sends the files.

Alternatively, could you from the AIX system do a get rather than a put from the AS400 system? And do your logging from the AIX system. And if the Linux system needs the records, just ftp the presumably much smaller log (compared to the files being ftp'd) from the AIX system to the Linux system.

Doing it this way, I think, will solve your ownership problem. You may have to chmod the files, but as you would be root on the AIX system, ftp'ing to the AS400 and logging on as user xyz, exiting, and then back to the AIX system as root, you could just do the chown and chmod as a matter of course.

In regard to your question "Maybe there's a more efficient way of doing this?": If you can't do the get from the AIX system and you still have to chmod and chown, every 5 or ten minutes, remember it's the computer that's doing it and it doesn't care how repetitive it is going to be. And it will only take a half a second, unless you are talking about chowning and chmoding thousands at a time (in which case, having to ftp the things twice is even more baffling).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top