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


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



Relevant Pages

  • Re: SEND COMMANDS VIA FTP ?
    ... or FTP Commands on the Remote. ... > I am transferring data files from a mainframe to a Win 2003 server ...
    (microsoft.public.windows.server.sbs)
  • Strange problem with wu-ftpd
    ... I could ftp from my local LAN without any problem. ... However, in the remote ftp session, I was unable to issue commands ...
    (linux.redhat.misc)
  • Re: cron job
    ... Is it possible to create a cron job which performs ftp to a remote ... (i.e. have root access to the remote system and have made ... though I wouldn't recommend doing ftp as root. ...
    (comp.unix.shell)
  • Re: webcam html and ftp servers: restricting access
    ... a webcam for monitoring a remote location. ... I plan to use apache2 to serve images which I can view from any ... someone steals the remote system; so if the remote system runs a ... script should be exclusive to ftp. ...
    (Debian-User)
  • cron job
    ... Is it possible to create a cron job which performs ftp to a remote ... I have the previlages on the remote ... (i.e. have root access to the remote system and have made ...
    (comp.unix.shell)