FTP query for remote date/time - TCP-IP
This is a discussion on FTP query for remote date/time - TCP-IP ; Hi everyone.
Does anybody know how to query an FTP server to get its date/time?
I mean, is there a standard command to do so?
Or some trick: some other command that gives back a formatted response
including date/time reference.
...
-
FTP query for remote date/time
Hi everyone.
Does anybody know how to query an FTP server to get its date/time?
I mean, is there a standard command to do so?
Or some trick: some other command that gives back a formatted response
including date/time reference.
Any help would be appreciated.
Thanks
-
Re: FTP query for remote date/time
In article <1164797423.581243.114100@j72g2000cwa.googlegroups. com>, "PG" writes:
> Hi everyone.
>
> Does anybody know how to query an FTP server to get its date/time?
>
> I mean, is there a standard command to do so?
No. There is no standard command to do so that I am aware of.
> Or some trick: some other command that gives back a formatted response
> including date/time reference.
ftp> put /dev/null timestamp.nul
ftp> dir timestamp.nul
11-29-06 07:29AM 3 timestamp.nul
ftp> del timestamp.nul
[Requires write access to a directory on the FTP server]
Specific FTP servers may provide something. For instance:
ftp> quote site spawn show time
200 29-NOV-2006 06:22:55
[It's highly unlikely that your target FTP server is running on VMS, so
this particular site specific command may not help much]
-
Re: FTP query for remote date/time
Hi
> ftp> put /dev/null timestamp.nul
> ftp> dir timestamp.nul
> 11-29-06 07:29AM 3 timestamp.nul
> ftp> del timestamp.nul
I already thought to something similar, based on the fact that files
remotely created/uploaded assume remote time.
And I wanted to avoid file creation/upload, because if this causes
problems, the client who wants to query server date/time to align to it
could hang up.
Anyway, thanks a lot, bye
-
Re: FTP query for remote date/time
On 29 Nov 2006, in the Usenet newsgroup comp.protocols.tcp-ip, in article
<1164797423.581243.114100@j72g2000cwa.googlegroups. com>, PG wrote:
>Does anybody know how to query an FTP server to get its date/time?
0959 File Transfer Protocol. J. Postel, J. Reynolds. October 1985.
(Format: TXT=147316 bytes) (Obsoletes RFC0765) (Updated by RFC2228,
RFC2640, RFC2773) (Also STD0009) (Status: STANDARD)
>I mean, is there a standard command to do so?
remotehelp [command-name]
Request help from the remote FTP server. If a command-name
is specified it is supplied to the server as well.
remotestatus [file-name]
With no arguments, show status of remote machine. If file-
name is specified, show status of file-name on remote ma-
chine.
site arg1 arg2 ...
The arguments specified are sent, verbatim, to the remote FTP
server as a SITE command.
_IF_ (and that's a mighty big 'if') the remote server is configured to offer
extra commands, you _might_ be able to use something like the UNIX 'date'
command, but that is HIGHLY dependent on the remote server, and how it's
configured.
>Or some trick: some other command that gives back a formatted response
>including date/time reference.
0867 Daytime Protocol. J. Postel. May 1983. (Format: TXT=2289 bytes)
(Also STD0025) (Status: STANDARD)
Again, this depends on how the server is set up. There is also an ICMP
timestamp request/reply (Type 13/14) but most people have this blocked or
disabled.
Old guy
-
Re: FTP query for remote date/time
In article ,
Moe Trin wrote:
>>Or some trick: some other command that gives back a formatted response
>>including date/time reference.
>
> 0867 Daytime Protocol. J. Postel. May 1983. (Format: TXT=2289 bytes)
> (Also STD0025) (Status: STANDARD)
>
>Again, this depends on how the server is set up. There is also an ICMP
>timestamp request/reply (Type 13/14) but most people have this blocked or
>disabled.
That is backward., The ICMP timestamp option often works, but few systems
answer UDP or TCP ports 37 or 13 and fewer firewalls pass them. The
`timedc` command common in BSD UNIX distributions tries to use port 37
and ICMP timestamps to measure the difference between local and remote
clocks. It is still often able figure out difference in time but
complains that remote systems refuse to divulge their notions of the
date.
I think the best solution for the sort of thing the other person asked
about has nothing to do with private FTP commands but to configure both
systems to tick good ticks with NTP. If both systems' clocks are
accurate to milliseconds, you don't need to ask about the clock at the
remote system.
The second best solution for the problem described is the kludge of
sending a file and then asking about its status. That can be secure
enough if you do not insist on anonymous FTP clients.
For the purpose I suspect but that was not mentioned, better than all
of those would be using a smart FTP client that sets the mtime on fetched
files to match the FTP server's, and that only fetches new versions of
files when the remote source change. I think the `wget`, `fetch`,
`curl`, and even many `ftp` commands can do that.
Vernon Schryver vjs@rhyolite.com