MiroirEOLE » Historique » Version 7
Version 6 (Thierry Bertrand, 12/02/2015 09:43) → Version 7/10 (Daniel Dehennin, 27/02/2015 15:44)
{{toc}}
h1. Mise en place d’un miroir des dépôts de paquet
h2. Introduction
Ce document décrit comment créer un miroir local des dépôts Ubuntu et project:eole. EOLE.
La méta-distribution project:eole EOLE se compose de plusieurs deux sources de paquets : paquets:
# 1. Les paquets de la distribution Ubuntu, nécessite à ce jour environ 600Gio d’espace disque ;
#
2. Les paquets du projet project:eole, EOLE, nécessite à ce jour environ 30Gio 15Gio d’espace disque, toute version confondue.
disque.
La mise en place d’un miroir ce fait donc en deux étapes.
h2. Utilisation de l’outil "ubumirror":https://launchpad.net/ubumirror pour Miroir Ubuntu et EOLE >= 2.4
La mise en place d’un miroir de paquet *@deb@* Ubuntu est réalisée faisable avec l’outil "ubumirror":https://launchpad.net/ubumirror "ubumirror":https://launchpad.net/ubuntu/%2Bsource/ubumirror en appliquant des patchs : les patchs fournis en réponse aux bugs "663992":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/663992 et "939379":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/939379
* "Arrêt si le miroir distant est en synchronisation":https://code.launchpad.net/~launchpad-baby-gnu/ubumirror/feature-abort-on-remote-update-in-progress
* "Définition du fichier de La configuration en ligne de commande":https://code.launchpad.net/~launchpad-baby-gnu/ubumirror/feature-set-config-and-log-files-from-command-line
Cet outil se charge de faire la synchronisation en deux passes afin de ne pas avoir de paquets référencés dans des indexes qui ne sont pas encore téléchargés
# Télécharger les nouveaux paquets deb
# Mettre à jour les indexes (*@Releases@*, *@Packages@*, *@Sources@*...)
L’outil peut être utilisé utilisée par un utilisateur non *@root@* avec le patch "Définition du fichier de configuration en ligne de commande":https://code.launchpad.net/~launchpad-baby-gnu/ubumirror/feature-set-config-and-log-files-from-command-line.
Vous pouvez l’installer dans le répertoire de l’utilisateur qui fera la synchronisation :
* Créer les répertoires nécessaires
<pre>
ftp@server:~$ mkdir -p bin .config/ubumirror log.d src mirror
</pre>
* Télécharger le dépôt bzr
<pre>
ftp@server:~$ bzr whoami "John Snow <john.snow@example.com>"
ftp@server:~$ bzr init-repo src/bzr-ubumirror
ftp@server:~$ bzr branch lp:ubumirror src/bzr-ubumirror/jsnow
ftp@server:~$ cd src/bzr-ubumirror/jsnow
</pre>
* Intégrer le premier patch
<pre>
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr merge lp:~launchpad-baby-gnu/ubumirror/feature-abort-on-remote-update-in-progress
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr commit -m "Merge branch feature-abort-on-remote-update-in-progress"
</pre>
* Intégrer le second patch
<pre>
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr merge lp:~launchpad-baby-gnu/ubumirror/feature-set-config-and-log-files-from-command-line
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr commit -m "Merge branch feature-set-config-and-log-files-from-command-line"
ftp@server:~/src/bzr-ubumirror/jsnow$ cd
</pre>
* Faire un lien symbolique pour l’installer
<pre>
ftp@server:~$ ln -s ~/src/bzr-ubumirror/jsnow/ubuarchive ~/bin/ubuarchive
</pre>
Un tâche cron permet une synchronisation régulière, par exemple :
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
15 3 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/test.conf
</pre>
En environnement nécessitant un mandataire HTTP, il projet EOLE est nécessaire d’exporter la variable *@RSYNC_PROXY@* : suivante
* Utilisation d’un nom d’hôte
<pre>
RSYNC_PROXY=FQDN_PROXY:PORT
</pre>
* Utilisation d’une adresse IP
<pre>
RSYNC_PROXY=IP_PROXY:PORT
</pre>
h3. Miroir Ubuntu
Nous synchroniserons le miroir une fois par jour, dans la nuit :
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
15 3 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/ubuntu.conf
</pre>
Vous pouvez baser votre configuration sur le modèle suivant :
<pre>
#
# ubumirror.conf - configuration file for the ubumirror scripts.
#
# Please set the variables below to fit your site.
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net
# Server's FQDN.
HOSTNAME=$(hostname -f)
# Bandwidth limit for all mirror scripts - set to 0 for no limit.
SPEED=10240
# UBUARC_DIR is the destination for the base of the archive directory
# The script won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/ubuntu/"
# UBUCDI_DIR is the destination for the base of the cdimage directory
# The script won't run if this variable isn't set
#UBUCDI_DIR="/srv/mirror/ubuntu-cdimage"
# UBUREL_DIR is the destination for the base of the releases directory
# The script won't run if this variable isn't set
#UBUREL_DIR="/srv/mirror/ubuntu-releases"
# UBUPOR_DIR is the destination for the base of the ports directory
# The script (ubuports) won't run if this variable isn't set
#UBUPOR_DIR="/srv/mirror/ubuntu-ports"
# LOGDIR is the destination directory of all the logs
LOGDIR="/home/ftp/log.d/ubuntu" LOGDIR="/hom/ftp/mirror/log.d/ubumirror/"
# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
# upstream mirrors where the ubumirror scripts will mirror from.
#UBUARC_MIRROR=ftp.crihan.fr::ubuntu/ UBUARC_MIRROR=ftp.crihan.fr::ubuntu/
UBUARC_MIRROR=rsync://ftp.lip6.fr/Ubuntu/archive/ # UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/
# UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/
# UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/
# UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR
# flavour names must match directory names on the mirror
# UBUCDI_FLAVOURS="\
# daily daily-live \
# ubuntu-netbook/daily-live ubuntu-server/daily \
# "
# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
UBUARC_EXCLUDE="\
--exclude binary-powerpc/ --exclude binary-sparc/ \
--exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
--exclude installer-powerpc/ --exclude installer-sparc/ \
--exclude *_powerpc.deb --exclude *_powerpc.udeb \
--exclude *_sparc.deb --exclude *_sparc.udeb \
--exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
--exclude pool/local \
"
UBUCDI_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
# --exclude source/ \
"
UBUREL_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
"
UBUPOR_EXCLUDE="\
# --exclude binary-powerpc/ --exclude binary-sparc/ \
# --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
# --exclude installer-powerpc/ --exclude installer-sparc/ \
# --exclude *_powerpc.deb --exclude *_powerpc.udeb \
# --exclude *_sparc.deb --exclude *_sparc.udeb \
# --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
"
</pre>
h3. h2. Miroir EOLE 2.4 et plus
Nous synchroniserons le
La mise en place d’un miroir une fois par jour, dans la nuit : EOLE pour les versions 2.4 et plus est faisable avec l’outil "ubumirror":https://launchpad.net/ubuntu/%2Bsource/ubumirror en appliquant les patchs fournis en réponse aux bugs "663992":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/663992 et "939379":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/939379
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
30 5 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/eole.conf
</pre>
Vous pouvez baser votre configuration sur le modèle suivant :
<pre>
#
# ubumirror.conf - configuration file for the ubumirror scripts.
#
# Please set the variables below to fit your site.
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net
# Server's FQDN.
HOSTNAME=$(hostname -f)
# Bandwidth limit for all mirror scripts - set to 0 for no limit.
SPEED=10240
# UBUARC_DIR is the destination for the base of the archive directory
# The script won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/eole/"
# LOGDIR UBUCDI_DIR is the destination directory of all for the logs
LOGDIR="/home/ftp/log.d/eole"
# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form base of host::directory/ of the cdimage directory
# upstream mirrors where the ubumirror scripts will mirror from. The script won't run if this variable isn't set
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/eole/
#UBUCDI_DIR="/srv/mirror/ubuntu-cdimage"
# UBU{ARC,CDI,REL}_EXCLUDE UBUREL_DIR is what things you want to exclude
UBUARC_EXCLUDE=""
</pre>
h3. Miroir Envole 4 et plus
Nous synchroniserons le miroir une fois par jour, dans la nuit :
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
30 6 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/envole.conf
</pre>
Vous pouvez baser votre configuration sur le modèle suivant :
<pre>
#
# ubumirror.conf - configuration file the destination for the ubumirror scripts.
#
# Please set base of the variables below to fit your site. releases directory
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net
# Server's FQDN.
HOSTNAME=$(hostname -f)
# Bandwidth limit for all mirror scripts - The script won't run if this variable isn't set to 0 for no limit.
SPEED=10240 #UBUREL_DIR="/srv/mirror/ubuntu-releases"
# UBUARC_DIR UBUPOR_DIR is the destination for the base of the archive ports directory
# The script (ubuports) won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/envole/" #UBUPOR_DIR="/srv/mirror/ubuntu-ports"
# LOGDIR is the destination directory of all the logs
LOGDIR="/home/ftp/log.d/envole" LOGDIR="/home/ftp/mirror/log.d/ubumirror/"
# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
# upstream mirrors where the ubumirror scripts will mirror from.
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/envole/
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/eole/
# UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/
# UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/
# UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/
# UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR
# flavour names must match directory names on the mirror
# UBUCDI_FLAVOURS="\
# daily daily-live \
# ubuntu-netbook/daily-live ubuntu-server/daily \
# "
# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
UBUARC_EXCLUDE=""
UBUCDI_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
# --exclude source/ \
"
UBUREL_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
"
UBUPOR_EXCLUDE="\
# --exclude binary-powerpc/ --exclude binary-sparc/ \
# --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
# --exclude installer-powerpc/ --exclude installer-sparc/ \
# --exclude *_powerpc.deb --exclude *_powerpc.udeb \
# --exclude *_sparc.deb --exclude *_sparc.udeb \
# --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
"
</pre>
En environnement proxyfié, il est nécessaire d'utiliser la variable
<pre>
RSYNC_PROXY=FQDN_PROXY:PORT
ou
RSYNC_PROXY=IP_PROXY:PORT
</pre>
h2. Miroir EOLE 2.3
La mise en place d’un miroir EOLE requiert une autorisation réseau préalable à "adresser à l’équipe EOLE":http://eole.orion.education.fr/index.php/contact, vous devez donc nous communiquer l’adresse IP qui sera utilisée par votre serveur miroir.
La récupération des paquets EOLE jusqu’à la version 2.3 se fait avec le script suivant :
<pre>
#!/bin/bash
set -e -u
MIRROR_SRC="eoleng.ac-dijon.fr::eoleng"
MIRROR_DST="/home/ftp/mirror/eoleng"
MIRROR_LOG_DIR="/home/ftp/mirror/log.d/eoleng"
MIRROR_LOG_FILE="${MIRROR_LOG_DIR}/eole.log"
RSYNC_OPTS="-v --force --recursive --times --perms --links --delete-after"
RSYNC_EXCLUDE="--exclude mini-dinstall --exclude *.changes"
test -d "${MIRROR_LOG_DIR}" || mkdir -p "${MIRROR_LOG_DIR}"
savelog -t -n -r "${MIRROR_LOG_DIR}" "${MIRROR_LOG_FILE}"
rsync ${RSYNC_OPTS} ${RSYNC_EXCLUDE} ${MIRROR_SRC} ${MIRROR_DST} | tee -a "${MIRROR_LOG_FILE}"
</pre>
Vous pouvez ensuite planifier une tâche cron comme suit:
<pre>
SHELL=/bin/bash
PATH=~/.bin:/usr/bin:/bin
MAILTO=mirror-admin@example.net
0 5 * * * mirror-eole.sh > /dev/null
</pre>
h2. Publication de votre miroir
Il ne vous reste plus qu’à configurer un service HTTP ou FTP afin de rendre votre miroir accessible.
h1. Mise en place d’un miroir des dépôts de paquet
h2. Introduction
Ce document décrit comment créer un miroir local des dépôts Ubuntu et project:eole. EOLE.
La méta-distribution project:eole EOLE se compose de plusieurs deux sources de paquets : paquets:
# 1. Les paquets de la distribution Ubuntu, nécessite à ce jour environ 600Gio d’espace disque ;
#
2. Les paquets du projet project:eole, EOLE, nécessite à ce jour environ 30Gio 15Gio d’espace disque, toute version confondue.
disque.
La mise en place d’un miroir ce fait donc en deux étapes.
h2. Utilisation de l’outil "ubumirror":https://launchpad.net/ubumirror pour Miroir Ubuntu et EOLE >= 2.4
La mise en place d’un miroir de paquet *@deb@* Ubuntu est réalisée faisable avec l’outil "ubumirror":https://launchpad.net/ubumirror "ubumirror":https://launchpad.net/ubuntu/%2Bsource/ubumirror en appliquant des patchs : les patchs fournis en réponse aux bugs "663992":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/663992 et "939379":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/939379
* "Arrêt si le miroir distant est en synchronisation":https://code.launchpad.net/~launchpad-baby-gnu/ubumirror/feature-abort-on-remote-update-in-progress
* "Définition du fichier de La configuration en ligne de commande":https://code.launchpad.net/~launchpad-baby-gnu/ubumirror/feature-set-config-and-log-files-from-command-line
Cet outil se charge de faire la synchronisation en deux passes afin de ne pas avoir de paquets référencés dans des indexes qui ne sont pas encore téléchargés
# Télécharger les nouveaux paquets deb
# Mettre à jour les indexes (*@Releases@*, *@Packages@*, *@Sources@*...)
L’outil peut être utilisé utilisée par un utilisateur non *@root@* avec le patch "Définition du fichier de configuration en ligne de commande":https://code.launchpad.net/~launchpad-baby-gnu/ubumirror/feature-set-config-and-log-files-from-command-line.
Vous pouvez l’installer dans le répertoire de l’utilisateur qui fera la synchronisation :
* Créer les répertoires nécessaires
<pre>
ftp@server:~$ mkdir -p bin .config/ubumirror log.d src mirror
</pre>
* Télécharger le dépôt bzr
<pre>
ftp@server:~$ bzr whoami "John Snow <john.snow@example.com>"
ftp@server:~$ bzr init-repo src/bzr-ubumirror
ftp@server:~$ bzr branch lp:ubumirror src/bzr-ubumirror/jsnow
ftp@server:~$ cd src/bzr-ubumirror/jsnow
</pre>
* Intégrer le premier patch
<pre>
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr merge lp:~launchpad-baby-gnu/ubumirror/feature-abort-on-remote-update-in-progress
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr commit -m "Merge branch feature-abort-on-remote-update-in-progress"
</pre>
* Intégrer le second patch
<pre>
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr merge lp:~launchpad-baby-gnu/ubumirror/feature-set-config-and-log-files-from-command-line
ftp@server:~/src/bzr-ubumirror/jsnow$ bzr commit -m "Merge branch feature-set-config-and-log-files-from-command-line"
ftp@server:~/src/bzr-ubumirror/jsnow$ cd
</pre>
* Faire un lien symbolique pour l’installer
<pre>
ftp@server:~$ ln -s ~/src/bzr-ubumirror/jsnow/ubuarchive ~/bin/ubuarchive
</pre>
Un tâche cron permet une synchronisation régulière, par exemple :
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
15 3 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/test.conf
</pre>
En environnement nécessitant un mandataire HTTP, il projet EOLE est nécessaire d’exporter la variable *@RSYNC_PROXY@* : suivante
* Utilisation d’un nom d’hôte
<pre>
RSYNC_PROXY=FQDN_PROXY:PORT
</pre>
* Utilisation d’une adresse IP
<pre>
RSYNC_PROXY=IP_PROXY:PORT
</pre>
h3. Miroir Ubuntu
Nous synchroniserons le miroir une fois par jour, dans la nuit :
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
15 3 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/ubuntu.conf
</pre>
Vous pouvez baser votre configuration sur le modèle suivant :
<pre>
#
# ubumirror.conf - configuration file for the ubumirror scripts.
#
# Please set the variables below to fit your site.
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net
# Server's FQDN.
HOSTNAME=$(hostname -f)
# Bandwidth limit for all mirror scripts - set to 0 for no limit.
SPEED=10240
# UBUARC_DIR is the destination for the base of the archive directory
# The script won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/ubuntu/"
# UBUCDI_DIR is the destination for the base of the cdimage directory
# The script won't run if this variable isn't set
#UBUCDI_DIR="/srv/mirror/ubuntu-cdimage"
# UBUREL_DIR is the destination for the base of the releases directory
# The script won't run if this variable isn't set
#UBUREL_DIR="/srv/mirror/ubuntu-releases"
# UBUPOR_DIR is the destination for the base of the ports directory
# The script (ubuports) won't run if this variable isn't set
#UBUPOR_DIR="/srv/mirror/ubuntu-ports"
# LOGDIR is the destination directory of all the logs
LOGDIR="/home/ftp/log.d/ubuntu" LOGDIR="/hom/ftp/mirror/log.d/ubumirror/"
# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
# upstream mirrors where the ubumirror scripts will mirror from.
#UBUARC_MIRROR=ftp.crihan.fr::ubuntu/ UBUARC_MIRROR=ftp.crihan.fr::ubuntu/
UBUARC_MIRROR=rsync://ftp.lip6.fr/Ubuntu/archive/ # UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/
# UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/
# UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/
# UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR
# flavour names must match directory names on the mirror
# UBUCDI_FLAVOURS="\
# daily daily-live \
# ubuntu-netbook/daily-live ubuntu-server/daily \
# "
# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
UBUARC_EXCLUDE="\
--exclude binary-powerpc/ --exclude binary-sparc/ \
--exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
--exclude installer-powerpc/ --exclude installer-sparc/ \
--exclude *_powerpc.deb --exclude *_powerpc.udeb \
--exclude *_sparc.deb --exclude *_sparc.udeb \
--exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
--exclude pool/local \
"
UBUCDI_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
# --exclude source/ \
"
UBUREL_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
"
UBUPOR_EXCLUDE="\
# --exclude binary-powerpc/ --exclude binary-sparc/ \
# --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
# --exclude installer-powerpc/ --exclude installer-sparc/ \
# --exclude *_powerpc.deb --exclude *_powerpc.udeb \
# --exclude *_sparc.deb --exclude *_sparc.udeb \
# --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
"
</pre>
h3. h2. Miroir EOLE 2.4 et plus
Nous synchroniserons le
La mise en place d’un miroir une fois par jour, dans la nuit : EOLE pour les versions 2.4 et plus est faisable avec l’outil "ubumirror":https://launchpad.net/ubuntu/%2Bsource/ubumirror en appliquant les patchs fournis en réponse aux bugs "663992":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/663992 et "939379":https://bugs.launchpad.net/ubuntu/%2Bsource/ubumirror/%2Bbug/939379
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
30 5 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/eole.conf
</pre>
Vous pouvez baser votre configuration sur le modèle suivant :
<pre>
#
# ubumirror.conf - configuration file for the ubumirror scripts.
#
# Please set the variables below to fit your site.
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net
# Server's FQDN.
HOSTNAME=$(hostname -f)
# Bandwidth limit for all mirror scripts - set to 0 for no limit.
SPEED=10240
# UBUARC_DIR is the destination for the base of the archive directory
# The script won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/eole/"
# LOGDIR UBUCDI_DIR is the destination directory of all for the logs
LOGDIR="/home/ftp/log.d/eole"
# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form base of host::directory/ of the cdimage directory
# upstream mirrors where the ubumirror scripts will mirror from. The script won't run if this variable isn't set
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/eole/
#UBUCDI_DIR="/srv/mirror/ubuntu-cdimage"
# UBU{ARC,CDI,REL}_EXCLUDE UBUREL_DIR is what things you want to exclude
UBUARC_EXCLUDE=""
</pre>
h3. Miroir Envole 4 et plus
Nous synchroniserons le miroir une fois par jour, dans la nuit :
<pre>
root@server:~$ crontab -u ftp -l
PATH=${HOME}/bin:${PATH}
30 6 * * * ${HOME}/bin/ubuarchive --conf ${HOME}/.config/ubumirror/envole.conf
</pre>
Vous pouvez baser votre configuration sur le modèle suivant :
<pre>
#
# ubumirror.conf - configuration file the destination for the ubumirror scripts.
#
# Please set base of the variables below to fit your site. releases directory
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net
# Server's FQDN.
HOSTNAME=$(hostname -f)
# Bandwidth limit for all mirror scripts - The script won't run if this variable isn't set to 0 for no limit.
SPEED=10240 #UBUREL_DIR="/srv/mirror/ubuntu-releases"
# UBUARC_DIR UBUPOR_DIR is the destination for the base of the archive ports directory
# The script (ubuports) won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/envole/" #UBUPOR_DIR="/srv/mirror/ubuntu-ports"
# LOGDIR is the destination directory of all the logs
LOGDIR="/home/ftp/log.d/envole" LOGDIR="/home/ftp/mirror/log.d/ubumirror/"
# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
# upstream mirrors where the ubumirror scripts will mirror from.
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/envole/
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/eole/
# UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/
# UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/
# UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/
# UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR
# flavour names must match directory names on the mirror
# UBUCDI_FLAVOURS="\
# daily daily-live \
# ubuntu-netbook/daily-live ubuntu-server/daily \
# "
# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
UBUARC_EXCLUDE=""
UBUCDI_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
# --exclude source/ \
"
UBUREL_EXCLUDE="\
# --exclude *-powerpc.* --exclude *-sparc.* \
"
UBUPOR_EXCLUDE="\
# --exclude binary-powerpc/ --exclude binary-sparc/ \
# --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
# --exclude installer-powerpc/ --exclude installer-sparc/ \
# --exclude *_powerpc.deb --exclude *_powerpc.udeb \
# --exclude *_sparc.deb --exclude *_sparc.udeb \
# --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
"
</pre>
En environnement proxyfié, il est nécessaire d'utiliser la variable
<pre>
RSYNC_PROXY=FQDN_PROXY:PORT
ou
RSYNC_PROXY=IP_PROXY:PORT
</pre>
h2. Miroir EOLE 2.3
La mise en place d’un miroir EOLE requiert une autorisation réseau préalable à "adresser à l’équipe EOLE":http://eole.orion.education.fr/index.php/contact, vous devez donc nous communiquer l’adresse IP qui sera utilisée par votre serveur miroir.
La récupération des paquets EOLE jusqu’à la version 2.3 se fait avec le script suivant :
<pre>
#!/bin/bash
set -e -u
MIRROR_SRC="eoleng.ac-dijon.fr::eoleng"
MIRROR_DST="/home/ftp/mirror/eoleng"
MIRROR_LOG_DIR="/home/ftp/mirror/log.d/eoleng"
MIRROR_LOG_FILE="${MIRROR_LOG_DIR}/eole.log"
RSYNC_OPTS="-v --force --recursive --times --perms --links --delete-after"
RSYNC_EXCLUDE="--exclude mini-dinstall --exclude *.changes"
test -d "${MIRROR_LOG_DIR}" || mkdir -p "${MIRROR_LOG_DIR}"
savelog -t -n -r "${MIRROR_LOG_DIR}" "${MIRROR_LOG_FILE}"
rsync ${RSYNC_OPTS} ${RSYNC_EXCLUDE} ${MIRROR_SRC} ${MIRROR_DST} | tee -a "${MIRROR_LOG_FILE}"
</pre>
Vous pouvez ensuite planifier une tâche cron comme suit:
<pre>
SHELL=/bin/bash
PATH=~/.bin:/usr/bin:/bin
MAILTO=mirror-admin@example.net
0 5 * * * mirror-eole.sh > /dev/null
</pre>
h2. Publication de votre miroir
Il ne vous reste plus qu’à configurer un service HTTP ou FTP afin de rendre votre miroir accessible.