savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Savannah-hackers-public] randy kobes passed away -> ftpmirror redir


From: Michael J. Flickinger
Subject: Re: [Savannah-hackers-public] randy kobes passed away -> ftpmirror redirector
Date: Sun, 27 Feb 2011 19:54:56 -0500
User-agent: Waffles

Currently the list is hosted on the download vm with the mirror list
here: /usr/local/share/GeoIP/gnu-ftpmirror.txt, as you've already found.

I'll write a script to update the mirror daily (later tonight, I hope.)

One problem here is that the Apache2::Geo::Mirror module only loads
the mirror list upon initialization of Apache, so every time the
list is updated, apache would need restarted, which I'd like to avoid.

I think the most sane thing to do here is subclass Apache2::Geo::Mirror
and add a simple feature that checks the last modified time of the /usr/local/share/GeoIP/gnu-ftpmirror.txt file; if it changes, reload the file.

Karl Berry wrote:
Hi Michael,

    Ok, this is testable now on http://gnu-ftpmirror.savannah.gnu.org

Wow, incredibly quick work, thanks.
It works fine for me too, right now.

Did you set up some method for updating it, though?  I did not see
anything new in the cron jobs, but I certainly could have missed it.
The mirror list changes all the time (e.g., today the artfiles.org url
changed from what I see in /usr/local/share/GeoIP/gnu-ftpmirror.txt).

Randy's redirector worked off the mirmon installed at
http://gnu-mirmon.basemirror.de (by other volunteers).  You can get that
mirmon status file from http://gnu-mirmon.basemirror.de/status.txt, also
to be fed into /usr/local/bin/mirmon2geoip.pl.

Then there's the matter of also getting the mirmon conf file for
mirmon2geoip.  The ultimate source is gnu.org/prep/FTP (or ftp.html).
The basemirror guys (contact info at the end of
/gd/gnuorg/web/FTP.contacts, I am hesitant to post email addresses
publicly) wrote another script to massage that into the mirmon conf
format.  We could also run that script, or (my preference, to ensure
that the mirmon data and site list are in sync) just get their resulting
file.

Unfortunately the script is written in an unreadable (to me anyway)
style, but here it is FWIW.

wget http://www.gnu.org/prep/ftp.html -O /root/mirmon-1.37/gnu-org-ftp.html
#
grep -i "<LI>" /root/mirmon-1.37/gnu-org-ftp.html | perl -lane
'm~^(\s*)<LI>(.+)~i;($sp,$l)=($1,$2);exit if(length($sp)>2);if($sp eq
q[]){$r=$l}if($r=~m~United States~i){$r.=q[ ]}else{$r=q[]}if($sp eq q[
]){$c=$l}if($l=~m~HREF="([^"]+)"~i){($l)=($1);}$l=~s~\s*<.*~~;if($sp
eq q[  ]){$rc=$r.$c;$rcm=$rc;$rcm=~s~[^a-z]+~-~gi;$rc=~s~\s{2,}~,
~;push @a,sprintf qq[%s %s\n],$rcm,$l;$h->{qq[$rcm]}=$rc;}sub
END{open(MLGF,">","/root/mirmon-1.37/mirror-list-gnu-ftp.txt");print
MLGF sort @a;open(CL,">","/root/mirmon-1.37/countries.list");foreach(sort
keys %{$h}){printf CL qq[%s %s\n],$_,$h->{qq[$_]}}}' ; cat
/root/mirmon-1.37/mirror-list-gnu-ftp.txt
#
/root/mirmon-1.37/mirmon -v -get update -c /root/mirmon-1.37/mirmon-gnu-ftp.conf

Thanks,
karl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]