AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  FTP Script gives error

    Posted Thu November 29, 2007 02:09 AM

    Originally posted by: SystemAdmin


    Hi
    I am trying to write an automated script, i wrote a script which is indented and looks like below

    mkdir /home/$user_name/cim_$dir
    chmod 754 /home/$user_name/cim_$dir
    echo "Enter source server"
    read SOURCESERVER < /dev/tty
    echo "Enter source folder"
    read SOURCEDIR < /dev/tty
    echo "Enter User Name for FTP the the files"
    read FTPUSER < /dev/tty
    echo "Enter Password for FTP the the files"
    read FTPPASSWD < /dev/tty
    ftp $REMOTEHOST<<!
    quote USER $FTPUSER
    quote PASS $FTPPASSWD
    lcd /home/$user_name/cim_$dir
    cd /home/$FTPUSER/hasan/cim
    ascii
    mget *
    quit
    !

    when I execute the script it gives ERROR as >>>>>
    USER csoei Access denied
    login with user first
    and some invalid command? output

    now when I tried to check the command ftp dissp15.gsa.nl.ibm.com
    output is as following >>>>>>

    csoei@dissp15;/home/csoei/hasan $ftp dissp15.gsa.nl.ibm.com
    Connected to dissp15.gsa.nl.ibm.com.
    220 dissp15 FTP server (Version 4.1 Mon Aug 8 19:37:26 CDT 2005) ready.
    Name (dissp15.gsa.nl.ibm.com:csoei): csoei
    530 User csoei access denied.
    Login failed.
    ftp> ftp dissp15.gsa.nl.ibm.com
    ?Invalid command
    ftp>
    ....any techie pls hlp
    #AIX-Forum


  • 2.  Re: FTP Script gives error

    Posted Thu November 29, 2007 08:19 AM

    Originally posted by: SystemAdmin


    One thing I can see wrong with your script right away is this. The variable $REMOTEHOST doesn't seem to be getting a value anywhere.

    HTH

    Jim Lane
    #AIX-Forum


  • 3.  Re: FTP Script gives error

    Posted Thu November 29, 2007 11:16 AM

    Originally posted by: SystemAdmin


    Ah.. thanks Jim...I fogot to mention I am taking value of this varaible from a txt file which i am executing in this script.
    Also I forgot to mention that both the host and target system I am usning are same for the testing purpose.

    Also I am interested to know what actually preventing the login even after providing a correct password when the ftp command is put in command line..

    Your help is higly appreciated...
    with regards
    nutechie

    Message was edited by: nutechie
    #AIX-Forum


  • 4.  Re: FTP Script gives error

    Posted Fri November 30, 2007 08:23 AM

    Originally posted by: SystemAdmin


    I believe you have to add a "-n" flag to the ftp command. That seems to make it work on my system.

    -Jim
    #AIX-Forum


  • 5.  Re: FTP Script gives error

    Posted Fri November 30, 2007 06:47 PM

    Originally posted by: jnordtome


    I didn't see the password prompt from you command line example. That is strange. Also, do you have a .netrc file in your home directory? An invalid password in the .netrc file could cause this type of error.
    #AIX-Forum