[HPADM] automated ftp with anonymous user id

From: Balaji Nathan (balajinathan2003@yahoo.com)
Date: Mon Nov 24 2003 - 11:32:26 EST


Hi admins,
I have a ftp script which in turns call another script.
The primary ftp script:
#!/bin/sh
#
#
DIR=/usr/local/bin
FILEHOME=/adminlog/data
LOG=/var/adm/data_ftp.log
ERR=/var/adm/data_ftp.err
# Check for system1data and do the ftp
cd $FILEHOME
if [ -f system1data ]
then
    echo "Script started :`date`" > $LOG
    echo "ftp of system1data has started" >> $LOG
    ftp -in < $DIR/ftp_data.sct >> $LOG 2> $ERR
    STATUS=$?
    # If the result code is not 0 or the size of the error log is > 0
    if [ STATUS -ne 0 -o -s $ERR ]
    then
        echo "An error occured with the ftp" >> $LOG 2>> $ERR
        exit
    else
        echo "ftp of system1data has finished" >> $LOG
 fi
else
    echo "system1data not found" >> $LOG
fi

The second script: (ftp_data.sct)
# more ftp_data.sct
open xxx.xxx.xxx.xxx
user anonymous guest@unknown
bin
cd datafolder
prompt
lcd /adminlog/data
mput syste*
bye
#

this is the error log:
Script started :Mon Nov 24 09:52:00 EST 2003
ftp of system1data has started
Connected to server. Logging in...
220 kenny Microsoft FTP Service (Version 5.0).
331 Password required for (null).
530 User (null) cannot log in.
Login failed.
Login with USER first.
Please login with USER and PASS.
Interactive mode on.
Local directory now /adminlog/data
mput system1data? Please login with USER and PASS.
Please login with USER and PASS.
ftp of system1data has finished
---------------------------------------------------------------------------------------------------------------------
If I run this script manually, then it takes the user id (anonymous) and password (guest@unknown); but not through the automated script.
any idea why?
Regards,
Balaji

---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:36 EDT