#SysAdmin – Optimizando el Debmirror

debmirrorBuenas a todos los lectores hoy les quiero compartir a todos un ejemplo de un script de debmirror optimizado en parte para no descargar todas las cosas de un repositorio, les dejo una copia del mismo y usen ustedes su propia imaginación.
#!/bin/sh

# Matamos el mirror si ya está corriendo
killall debmirror

ARQUITECTURA=armhf
METODO=http
RAMAS=wheezy
HOST_PRINCIPAL=mirrordirector.raspbian.org
HOST_RPI=raspberrypi.collabora.com
HOST_RAS=archive.raspberrypi.org
DIR_REPOS=/home/armandof/repos
DIR_PRINCIPAL=/home/armandof/repos/raspbian
DIR_RPI=/home/armandof/repos/raspberrypi-rpi
DIR_RAS=/home/armandof/repos/raspberrypi-main
WORD=grep Errors /tmp/raspbian.log

echo “=====================================================”
echo “Actualizando los repositorios de RASPBIAN”
echo “=====================================================”
echo “”

echo “== REPOSITORIO PRINCIPAL ==”
echo “”
debmirror \
–arch=${ARQUITECTURA} \
–section=main,contrib,non-free,rpi \
–host=${HOST_PRINCIPAL} \
–root=/raspbian \
–dist=${RAMAS} \
–progress \
–method=${METODO} \
–ignore-release-gpg \
–ignore-small-errors \
–exclude-deb-section=’^debug$’ \
–exclude=’help-.*\.deb$’ \
–include=’help-es.*\.deb$’ \
–include=’help-en.*\.deb$’ \
–exclude-deb-section=doc \
–exclude-deb-section=electronics \
–exclude-deb-section=games \
–exclude-deb-section=hamradio \
–exclude-deb-section=kde \
–exclude-deb-section=gnome \
–exclude-deb-section=misc \
–exclude-deb-section=graphics \
–exclude-deb-section=math \
–exclude-deb-section=science \
–exclude-deb-section=sound \
–exclude-deb-section=tex \
–exclude-deb-section=text \
–exclude-deb-section=video \
–exclude-deb-section=xfce \
–exclude-deb-section=editors \
–nosource \
–diff=none \
–postcleanup \
–proxy=http://192.168.0.1:3128/ \
${DIR_PRINCIPAL}

echo “”
echo “== REPOSITORIO RPI ==”

echo “”
debmirror \
–arch=${ARQUITECTURA} \
–section=rpi \
–host=${HOST_RPI} \
–dist=${RAMAS} \
–progress \
–method=${METODO} \
–ignore-release-gpg \
–nosource \
–diff=none \
–postcleanup \
${DIR_RPI}
echo “”

echo “== REPOSITORIO RAS ==”
echo “”
debmirror \
–arch=${ARQUITECTURA} \
–section=main \
–host=${HOST_RAS} \
–root=/debian \
–dist=${RAMAS} \
–progress \
–method=${METODO} \
–ignore-release-gpg \
–nosource \
–diff=none \
–postcleanup \
${DIR_RAS}

echo “”
if [ -n “$WORD” ]

then

/home/armandof/repos/actrepos.txt > /tmp/raspbian.log

else

echo “Mirror sin problemas :)” >> /tmp/raspbian.log
cd ${DIR_REPOS}
du -hsc * –exclude=*.txt > raspbian.txt
chown -R nobody:nogroup raspbian.txt
chmod -R 644 raspbian.txt

cd ${DIR_PRINCIPAL}
chown -R nobody:nogroup *
chmod -R 755 *

cd ${DIR_RPI}
chown -R nobody:nogroup *
chmod -R 755 *

cd ${DIR_RAS}
chown -R nobody:nogroup *
chmod -R 755 *

fi

 

(Visited 52 times, 1 visits today)
Sobre Armando Felipe Fuentes Denis 124 Artículos
Network Administrator and Telematic Services in Federation of Radio Amateurs of Cuba Residencia: Regla, La Habana Email: [email protected] Movil: +53 58319403

Sé el primero en comentar

Dejar una contestacion

Tu dirección de correo electrónico no será publicada.


*