cURL / Mailing Lists / curl-users / Single Mail

curl-users

time condition -z with head -I option?

From: Morgan Read <mstuff_at_read.org.nz>
Date: Thu, 22 Mar 2007 14:42:30 +1200

Hello Folks

Only ref I can see from the list re the -z options is way back:
news://news.gmane.org:119/Pine.LNX.4.53.0304060931000.9186@linux3.contactor.se

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

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

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

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.

Any ideas what I'm missing, or alternatives?

Regards,
Morgan.

Examples follow:

[morgan_at_morgansmachine ~]$ curl -I -z yesterday
http://www.read.org.nz/index.html
Warning: Illegal date format for -z/--timecond (and not a file name).
Warning: Disabling time condition. See curl_getdate(3) for valid date
syntax.
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 00:07:45 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 00:07:45 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -I -z -yesterday
http://www.read.org.nz/index.html
Warning: Illegal date format for -z/--timecond (and not a file name).
Warning: Disabling time condition. See curl_getdate(3) for valid date
syntax.
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 02:29:15 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 02:29:15 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -I -z -index.html
http://www.read.org.nz/index.html
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 00:11:41 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 00:11:41 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -I -z index.html
http://www.read.org.nz/index.html
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 00:12:01 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 00:12:01 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -z index.html
http://www.read.org.nz/index.html
[morgan_at_morgansmachine ~]$

[morgan_at_morgansmachine ~]$ curl -I -z Thu, 22 Mar 2007 00:12:01 GMT
http://www.read.org.nz/index.html
Warning: Illegal date format for -z/--timecond (and not a file name).
Warning: Disabling time condition. See curl_getdate(3) for valid date
syntax.
curl: (7) Failed to connect to 0.0.0.22: Invalid argument
curl: (6) Couldn't resolve host 'Mar'
curl: (7) Failed to connect to 0.0.7.215: Invalid argument
curl: (6) Couldn't resolve host '00:12'
curl: (6) Couldn't resolve host 'GMT'
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 00:13:41 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 00:13:41 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -I -z "Thu, 22 Mar 2007 00:12:01 GMT"
http://www.read.org.nz/index.html
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 00:13:55 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 00:13:55 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -I -z -"Thu, 22 Mar 2007 00:12:01 GMT"
http://www.read.org.nz/index.html
HTTP/1.1 200 OK
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
Cache-control: public
Expires: Thu, 22 Mar 2007 00:14:25 GMT
Content-Length: 3840
Content-Type: text/html
Date: Thu, 22 Mar 2007 00:14:25 GMT
Server: GFE/1.3

[morgan_at_morgansmachine ~]$ curl -z index.html
http://www.read.org.nz/index.html
[morgan_at_morgansmachine ~]$

[morgan_at_morgansmachine ~]$ curl -I -z -"Thu, 22 Mar 2007 00:12:01 GMT"
http://www.read.org.nz/index.html | grep Last-Modified
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 3840 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:--
    0
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
[morgan_at_morgansmachine ~]$ curl -I -z -"Thu, 22 Mar 2007 00:12:01 GMT"
http://www.read.org.nz/index.html | grep Last-Modified
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 3840 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
    0
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT
[morgan@morgansmachine ~]$ curl -I http://www.read.org.nz/index.html |
grep Last-Modified
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 3840 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
    0
Last-Modified: Sat, 03 Feb 2007 02:07:28 GMT

-- 
Morgan Read
NEW ZEALAND
<mailto:mstuffATreadDOTorgDOTnz>
fedora: Freedom Forever!
http://fedoraproject.org/wiki/Overview
"By choosing not to ship any proprietary or binary drivers, Fedora does
differ from other distributions. ..."
Quote: Max Spevik
       http://interviews.slashdot.org/article.pl?sid=06/08/17/177220
RMS on fedora:
       http://fedoraproject.org/wiki/FreeSoftwareAnalysis/FSF

Received on 2007-03-22