Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: OT - Unix Script to get file name and size from remote server

RE: OT - Unix Script to get file name and size from remote server

From: Kevin Lange <kgel_at_ppoone.com>
Date: Fri, 01 Mar 2002 07:40:50 -0800
Message-ID: <F001.0041CCF8.20020301074050@fatcity.com>

  1. I can run the ls command inside of FTP with the -al parameters and I get then entire file list WITH the size parameters.
  2. I can run the rsh command with the ls -al command and I get the remote information as well.

So ... first, try the ls -al command inside of FTP to see if you get the full list.

Second, instead of a size list have you considered using the sum command to get a checksum of the file and then comparing that ?? If the files need to be an exact match this would be more accurate.

Third, instead of size or sum how about doing a wc -l command to get a line count instead of a size. You could run a remote find command with the -exec flag to execute the wc -l on the filenames and grab linecounts. This could be compared to the same find on your local machine.

Anyway, there are a lot of ways to do this. If you need help in setting any of them up, contact me directly (klange_at_avidyn.com).

-----Original Message-----
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: nmccormick_at_sbti.com

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: ListGuru_at_fatcity.com (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: Kevin Lange
  INET: kgel_at_ppoone.com
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: ListGuru_at_fatcity.com (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). Received on Fri Mar 01 2002 - 09:40:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US