cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: time condition -z with head -I option?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 22 Mar 2007 15:36:26 +0100 (CET)

On Thu, 22 Mar 2007, Morgan Read wrote:

> But -z doesn't seem to be operating as expected, particularly with the -I
> --head option?

Uh, what do you expect -z to do when all you ask for is --head ?

> -z seems to fail with the examples used here:
> http://curl.haxx.se/docs/manual.html
> (At least the "yesterday" example, see below.)

Ouch, yes indeed. That date format hasn't been supported for several years!
I'll need to update the manual.

> Also, seems dates need to be surrounded by ""?

Yes, if they include space.

> So, tried greping on date last modified to provide something simple to work
> on, but I seemed to get additional output...?

?

> I'm trying to monitor changes to a file on an http file server from my
> router, so can't afford a full download for comparison.

Then do it like this:

  curl -z file -o file http://mysite.overthere/remotefile.html

... which only downloads the remote file if it is newer than your local copy.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-03-22