I finally got the ls -l command with ftp working.  It didn't like having the
remotedirectory specified so I just do a cd to the remote directory and then
ls -l with the local file name.

Here is a snippet from the script I am running right now

# set variables
SITE_DIR=$1; export SITE_DIR
. DWH.ENV
. $SITE_DIR.ENV
#
# generate ftp command list
rm $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'ftp -n -v << *EOI ' >> $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'open '$RSRV >> $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'user '$FTPU' '$FTPP >> $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'cd '$RDIR >> $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'get report.nite.list' >> $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'ls -l '$SITE_DIR'_files.lst' >> $KSH_DIR/ftp_$SITE_DIR.ksh
echo 'bye ' >> $KSH_DIR/ftp_$SITE_DIRksh
echo '*EOI ' >> $KSH_DIR/ftp_$SITE_DIR.ksh
chmod 744 $KSH_DIR/ftp_$SITE_DIR.ksh
#
# execute ftp command
cd $KSH_DIR
$KSH_DIR/ftp_$SITE_DIR.ksh

I am going to continue to look at the rsh options as the commands I can
execute via rsh may produce more reliable results.

Thanks to everyone who responded for your help and suggestions.
Nancy

-----Original Message-----
McCormick
Sent: Friday, March 01, 2002 9:09 AM
To: Multiple recipients of list ORACLE-L


This may be a little off topic so I apologize in advance.  But I have seen
some good Unix scripting help come across lately so I thought I would go
ahead and send this.

I am trying to setup a Unix script that will logon to a remote server, get
the name and size of all the files in a remote directory and write the
results to a local directory.  I need to do this to ensure that all the
source files for loading our data warehouse have been received and are
complete.  The list of files to be received changes nightly and I don't have
the ability to add a record to the files that would provide an "end of file
marker".

I have tested ftp using "ls" but it only allows a short list of file names,
not the long listing with file sizes.  I have also tried nlist, size and dir
from ftp but those commands don't allow printing the results to the local
server.

I have tried rsh and rlogin but these commands just sit there with no
response.  I have to use an ip address, not the hostname, so I don't know if
this is the problem or not.  I have the SA looking into this for me.

I could probably setup a cron job on the remote server to do the long
listing of the directory and then ftp the results to my local server, but
then this would be outside the control of my load process.  I would prefer
to do everything from the local server if possible.

Any ideas?

Thanks,
Nancy


--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Nancy McCormick
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Nancy McCormick
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to