The italian mirror (www.it.htdig.org) now support full ftp and http
mirror (even patch and files) and is updated daily.

The new mirror script use puf to get files over http from mainsite,
and use the index.html files to remove old files.

The URIS are: 
http://www.it.htdig.org/files/
http://www.it.htdig.org/htdig-patches/
ftp://ftp.it.htdig.org/pub/htdig/files
ftp://ftp.it.htdig.org/pub/htdig/htdig-patches

The mirror script is attached.

-- 
---------------------------------------------------------------------
|    Marco Nenciarini    | Debian/GNU Linux Developer - Plug Member |
| [EMAIL PROTECTED] | http://www.prato.linux.it/~mnencia       |
---------------------------------------------------------------------
Key fingerprint = FED9 69C7 9E67 21F5 7D95  5270 6864 730D F095 E5E4

#!/bin/bash

PATH=/bin:/usr/bin:/usr/local/bin
BASEDIR=/org/www.it.htdig.org
WWWDIR=$BASEDIR/www
FTPDIR=$BASEDIR/ftp
FILEDIR=$FTPDIR/files
TMPDIR=$BASEDIR/tmp

set -e

# Update web
cd $WWWDIR
/usr/bin/cvs -q -z6 update -Pd

# Update files
cd $FTPDIR
puf -r -u -ns -xi .ht-update-in-progress.puf http://www.htdig.org/files > 
/dev/null

# Purge old files
listfiles() {
    test -r "$1" &&
    cat $1 | \
    sed -ne "s/\HREF=/\n%=/ig;
         s/%=\"\([^\"]*\)\"/%=\1\n/g;
         /^[^%][^=]/D;
         :loop;
         [EMAIL PROTECTED]@[EMAIL PROTECTED];
         T no;
         P;
         :no;
         D;
         b loop" | \
    grep -v "?\|^$2/"
}

rm -f $TMPDIR/filesok
exec 3> $TMPDIR/filesok
echo $FILEDIR >&3
newfiles=$(listfiles $FILEDIR/.ht-update-in-progress.puf $FILEDIR/)
while [ -n "$newfiles" ]; do
    files=$newfiles
    newfiles=
    for file in $files; do
        if [ -d $file ]; then
            file=${file%/}
            newfiles="$newfiles $(listfiles $file/.ht-update-in-progress.puf 
$file/)"
        fi
        echo $file >&3
    done
done
exec 3> /dev/null

rm -f $TMPDIR/filesok.sort $TMPDIR/files.sort
sort $TMPDIR/filesok > $TMPDIR/filesok.sort
find $FILEDIR | sort > $TMPDIR/files.sort

diff $TMPDIR/files.sort $TMPDIR/filesok.sort | sed -ne "s/^< \(.*\)$/\1/p" | 
xargs rm -fr

rm -f $TMPDIR/filesok.sort $TMPDIR/files.sort $TMPDIR/filesok

##Update patches
wget -q -nv -m -np -nH -p ftp://ftp.ccsf.org/htdig-patches
find . -name .listing -exec rm -f {} \;

Attachment: signature.asc
Description: Digital signature

Reply via email to