Re: Script that checks for existence of file on remote server.
From: steven_nospam at Yahoo! Canada (steven_nospam_at_yahoo.ca)
Date: 01/05/05
- Next message: Alvin Liau: "Re: Slow network problems"
- Previous message: Alvin Liau: "Connect to Shark and Fast-T"
- In reply to: Laurenz Albe: "Re: Script that checks for existence of file on remote server."
- Next in thread: vegas_girlie: "Re: Script that checks for existence of file on remote server."
- Reply: vegas_girlie: "Re: Script that checks for existence of file on remote server."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 Jan 2005 05:08:50 -0800
If I read the message correctly, I suspect Minnie wanted a way to check
that the file was FTP'd over onto the REMOTE system, not to check
locally...I may be wrong.
If you are administrator of both systems and can do remote shell
commands, you can simply set up so that you can issue "rsh" commands.
Check into the rsh command and .rhosts or hosts.equiv files.
If you must use FTP to do this, you can always capture your FTP
commands and output to a file, then scan that output file for the
expected returned FTP messages. For example, you may see something like
the following:
-----------------------------------------------------------------------------------
ftp> put sample.dat
200 PORT command successful.
150 Opening data connection for sample.dat.
226 Transfer complete.
5098 bytes sent in 0.01821 seconds (273.4 Kbytes/s)
local: sample.dat remote: sample.dat
ftp> quit
221 Goodbye.
-------------------------------------------------------------------------------------
You could use "grep" to scan for "^226 Transfer complete." or look for
the "bytes sent" line and grab the number of bytes, then compare it to
the one you have locally. I believe they are usually the same size...
Just some ideas for you to think about ;-)
Steve
- Next message: Alvin Liau: "Re: Slow network problems"
- Previous message: Alvin Liau: "Connect to Shark and Fast-T"
- In reply to: Laurenz Albe: "Re: Script that checks for existence of file on remote server."
- Next in thread: vegas_girlie: "Re: Script that checks for existence of file on remote server."
- Reply: vegas_girlie: "Re: Script that checks for existence of file on remote server."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|