jigdo - avoid unneeded .iso rebuild
I am trying to figure out how to poll a web server and only run the a process
(see below) when the .jigdo file has been updated.
I can get the Last-Modified timestamp from the server, and I can parse the
output from wget looking for "Server file no newer than local file" but I am
hoping there is a more elegant way.
$ curl --head http://cdimage.ubuntu.com/daily/current/edgy-alternate-i386.jigdo
HTTP/1.1 200 OK
Date: Mon, 11 Sep 2006 23:15:50 GMT
Server: Apache/2.1.3 (Ubuntu)
Last-Modified: Mon, 11 Sep 2006 06:34:10 GMT
ETag: "3c5c002-1ee7d-bede1c80"
Accept-Ranges: bytes
Content-Length: 126589
Content-Type: text/plain
$ wget -N http://cdimage.ubuntu.com/daily/current/edgy-alternate-i386.jigdo
--18:19:49-- http://cdimage.ubuntu.com/daily/current/edgy-alternate-i386.jigdo
=> `edgy-alternate-i386.jigdo'
Resolving cdimage.ubuntu.com... 195.248.90.25, 195.248.90.24
Connecting to cdimage.ubuntu.com|195.248.90.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 126,589 (124K) [text/plain]
Server file no newer than local file `edgy-alternate-i386.jigdo' -- not retrieving.
Current script I would like run soon after a new .jigdo is posted. do I really
need to rm the previous files?
# update edgy-alternate-i386.iso
cd new
rm edgy-alternate-i386.jigdo edgy-alternate-i386.template jigdo-file-cache.db
jigdo-lite --scan ../alternate
http://cdimage.ubuntu.com/daily/current/edgy-alternate-i386.jigdo
cd ..
umount alternate
mv -f new/edgy-alternate-i386.iso .
mount alternate
Carl K
Reply to: