wiki:mirrors/httpstatic

Version 3 (modified by Justin R. Knierim, 18 years ago) (diff)

Added scripts for rsyncing clfs-www

ClfsToc?

CLFS HTTP Static Mirroring

Go back to mirrors page

How do I do it?

To be a CLFS Static HTTP mirror, you will need the following:

  • Apache Webserver or equivalent
    • Options FollowSymlinks Indexes
  • 500MB free disk space
  • crontab program or similar

There is a script below which you can use to rsync the website and associated data to your mirror. We recommend syncing twice an hour, at random minutes. Once you have the mirror ready to go, please contact Justin Knierim at admin@… with the information below. You can then be added to the mirrors list. Also should you have questions, feel free to ask.

  • URL
  • Connection Speed
  • Location (City, Country, or other location indicator)
  • Contact Information (Name, Email Address)

Website Rsync Scipt

There are many ways to setup the rsync of the website. A basic bash script is shown below, which will rsync the website and email you should there be any errors:

#!/bin/sh

SITE=cross-lfs.org
MODULE=clfs-www
LOCAL=/path/to/mirror                  # Change this value
USER=admin@domain.com                  # Change this value
MAILER=/usr/sbin/sendmail              # Change this value

[ -d "$LOCAL" ] || mkdir -p $LOCAL

OUTPUT=`rsync -clprtv --delete ${SITE}::${MODULE} ${LOCAL} 2>&1`

if [ $? -ne 0 -o `echo -e "${OUTPUT}" | wc -l` -ne 4 ] ; then
    (echo -e "Subject: cross-lfs.org mirror - Rsync Error\n"; echo -e "${OUTPUT}") | ${MAILER} ${USER};
fi

The most basic would be just running the rsync command directly in cron or fcron:

rsync -clprt --delete cross-lfs.org::clfs-www /path/to/mirror

Go back to mirrors page