AIX - FTP


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users AIX - FTP
# 1  
Old 06-27-2010
AIX - FTP

Hello,

I have a FTP script below that automatically send files to host. Currently, i am having problems if our network connection is down. Our host cannot receive a file once the network connect is down.

Could there be a additional command that i need to add below so that it would not send files if the network connection is down? It would send this file if the network connection is restored. Because currently we have to check and send it manually. This is VI script though. Thanks.


Code:
ftp -n -v testIP << %EOF

user test test2
quote site namefmt 1
bin
put /mydir/RMR_09.txt /theirdir/C$dt-09.txt
put /mydir/sRMR_09.txt /theirdir/S$dt-09.txt

Moderator's Comments:
Mod Comment Use code tags please, ty.

Last edited by vibora; 07-15-2010 at 06:30 AM.. Reason: code tags
# 2  
Old 06-28-2010
Checking if network is up before you try to ftp will not help if the network goes while a transfer is happening.
I don't know how long a ftp-client usually "hangs" until it receives a timeout and if it really spits out a return code >1 in that case (it should). Different ftp-clients might have different options for this.

ftp is not encrypted and unsecure - maybe switch to ssh/scp/sftp and set up public key authentication, if it is an option. You would also not have to write clear passwords in a file.
You can use helpful options with scp for example like:
Code:
    ConnectionAttempts
    ConnectTimeout

see man scp.

You can script a lot of things around it to make it more waterproof for your problem case, but generally I'd say you should try to solve that network problem as priority and implement the ssh/scp/sftp protocol suite.
# 3  
Old 06-29-2010
Oh.. i was not able to put it inside the code box. My apologies.

Anyway, my FTP script is currently in CRON so I cannot see if there was a problem during the transmission of the file. Is there a audit trail that pertains to FTP?
# 4  
Old 07-06-2010
I am not into auditing but there is a RedBook available for that topic from IBM on their RedBook website. Also auditing is more about permissions, who may do what or did what etc. I doubt it has any functionality to check your logics about network down and broken ftp transfers.
My guess is you have to script a bit something yourself to represent the logic needed to do all necessary checks. Maybe you have some job control tool that can help with that.
# 5  
Old 07-15-2010
But is it possible that those files that were not sent through FTP will go on a specified directory (eg. UNPROCESSED directory)? If so, would it be possible to add it in my FTP script above?

Also, i decided in putting a log file on the FTP but apparently it displays all the FTP details during the transmission. Is it possible to only save those lines that corresponds with FTP failure? Or only save a specific word in the file (eg. subcommand received).

EDIT:

Since I can add a "grep" command inside my FTP script, I can minimize the information down to my desired word or phrase. However, I still don't know the exact message when network connection went down during FTP.

Is there anyone who could share it with me?

Code:
ftp -n -v testIP << %EOF >> /home/logftp.txt

user test test2
quote site namefmt 1
bin
put /mydir/RMR_09.txt /theirdir/C$dt-09.txt
put /mydir/sRMR_09.txt /theirdir/S$dt-09.txt

Thanks.

Last edited by vibora; 07-23-2010 at 02:39 AM.. Reason: additional info.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX Forum: FTP from AIX to Mainframe

This discussion thread is an extension to what was discussed in Shell scripting section. Please refer the post for the requirement: Requirement Post - Click Here The whole thread - Click Here I would like to know how I can use NDM to transfer file from AIX to Mainframe and to verify the... (3 Replies)
Discussion started by: TechGyaann
3 Replies

2. Shell Programming and Scripting

FTP from AIX to Mainframe

Hi All, This is the scenario:- I am writing a script to automate FTP files from AIX to Mainframe. ( Binary mode, passive connection) FTP the currently available files(poll a directory to find the list) and put it to mainframe in one connection instance Verify if all the files are copied... (24 Replies)
Discussion started by: TechGyaann
24 Replies

3. Shell Programming and Scripting

AIX FTP client

I am trying to transfer logs from Aix 6.1 to a linux appliance but it is not happening from last one month if i execute the batch command by command i can execute well but if i do it in shell script it is stuck without any error. Any one know how to generate a FTP client trace to know the issue... (10 Replies)
Discussion started by: ra8ul
10 Replies

4. AIX

AIX FTP issue

Hi, I ftpd "binary" mode into a AIX server and transferred .tar.tar files. When i untar using "tar -xvf <filename>.tar.gz" It shows "tar: 0511-169 A directory checksum error on media; 0 not equal to 70568." Please Help!! (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

5. AIX

AIX - read only FTP

Hi, I want to set FTP server on AIX to read only mode. I found out manual page for /etc/ftpaccess.ctl (manual page ). I tried put readonly: ALL or readonly: ALL writeonly: NONE and nothing happened (of course, I restart FTP server by stopsrc -t ftp; startsrc -t ftp) (2 Replies)
Discussion started by: henriette
2 Replies

6. AIX

FTP Script error - AIX

Hi, I'm trying to create a ftp script so I can make an ftp connection and start upload and download files from/to remote servers. In this case I want to start a connection (crontab) and transfer files from localserver1 to remoteserver; remoteserver to localserver1; finally from localserver1... (3 Replies)
Discussion started by: marques_rmc
3 Replies

7. AIX

FTP on AIX

Hi All We have planned to communicate with our trading prtner via FTP. We both have servers running on AIX. We want to exchange files with each other via FTP. I am new to AIX. Any help appreciated:) Thanks:) (7 Replies)
Discussion started by: user1183
7 Replies

8. AIX

chrooted FTP in AIX

Hi, I want to configure chrooted FTP (not Proftpd) in AIX. What are the steps to perform this configuration and which and config files in AIX to configure? Thanks (1 Reply)
Discussion started by: imad77
1 Replies

9. AIX

How to secure ftp in AIX

Hi, the default ftp that comes with AIX5L is not secured as far as i know. How to install and use the secured FTP in AIX? Linux these days uses vsftpd daemon(very secured FTP daemon) is there VSFTPD for AIX? if there is any where can i download it from? thanks and regards Pchangba (1 Reply)
Discussion started by: pchangba
1 Replies

10. Shell Programming and Scripting

FTP from AIX to 20 Windows clients

I have got a unix server ( AIX ) and 20 clients ( windows 2000 ) . I have to transfer a file through FTP from the server to each of 20 clients daily to check the network speed. But each time I do ftp, I have to enter username and password and then transfer the file using "put <filename>". I... (2 Replies)
Discussion started by: sharuvman
2 Replies
Login or Register to Ask a Question