#!/bin/bash # Crea un espejo de Debian a medida. # security para sarge i386. # main contrib non-free. # Sin fuentes. # Sin ramas games, science, oldlibs, hamradio, otherosfs, news, electronics, math # Exluye variantes locales de muchos paquetes, y otros que no uso. # Incluye bc y variantes de paquetes es, fr y en. # Ignora pequeños errores. # Ignora la falta de release y de release-gpg. # Modo verbose. echo -e "Inicio de la actualización: `date`\n" # # # # # # # # # # # # # # # # # # # # # Definición de espejo para SARGE y SID # # # # # # # # # # # # # # # # # # # # # # espejo="/repositorio/debian" host='--host=ftp.es.debian.org' method='--method=ftp' root='--root=/debian' dist='-d sid,sarge' arch="--arch=i386" section="--section=main,contrib,non-free" source="--nosource" modif='--exclude-deb-section="games|science|oldlibs|hamradio|otherosfs|news|electronics|math" --exclude=".*-af_.*" --exclude=".*amd64.*" --exclude="ami.*" --exclude=".*-ar_.*" --exclude="atlas.*" --exclude="atmel-firmware.*" --exclude=".*-az_.*" --exclude="bcm5700-source.*" --exclude="beneath-a-steel-sky.*" --exclude=".*-bg_.*" --exclude="bible-kjv.*" --exclude="bibletime.*" --exclude=".*-bn_.*" --exclude="bomberclone.*" --exclude=".*-br_.*" --exclude=".*-bs_.*" --exclude="bsdgames.*" --exclude=".*-ca_.*" --exclude=".*canna.*" --exclude="canna.*" --exclude="cl-faq.*" --exclude="cmap-adobe-.*" --exclude=".*-cs_.*" --exclude=".*-cy_.*" --exclude=".*-da_.*" --exclude=".*-de_.*" --exclude="diatheke.*" --exclude="dict-easton.*" --exclude="dict-freedict.*" --exclude="dict-hitchcock.*" --exclude="doc-linux-.*" --exclude="ebook-dev-ggad.*" --exclude="ebook-dev-kde.*" --exclude="edict-fpw.*" --exclude=".*-el_.*" --exclude="electricsheep.*" --exclude=".*emt64t.*" --exclude=".*-en-gb_.*" --exclude=".*-eo_.*" --exclude=".*-et_.*" --exclude=".*-eu_.*" --exclude=".*-fa_.*" --exclude=".*-fi_.*" --exclude="firmware-ipw.*" --exclude="firmware-qlogic.*" --exclude=".*-fy_.*" --exclude=".*-ga_.*" --exclude="gazetteer.*" --exclude="gdm_.*" --exclude="geomview.*" --exclude=".*-gl_.*" --exclude="gnomesword.*" --exclude="grokking-the-gimp.*" --exclude="gtk-im-libthai.*" --exclude=".*hangul.*" --exclude="hanterm.*" --exclude=".*-he_.*" --exclude=".*-hi_.*" --exclude="hlatex.*" --exclude=".*-hr_.*" --exclude=".*-hu_.*" --exclude="iamerican.*" --exclude="ibrazilian.*" --exclude="ibulgarian.*" --exclude="icatalan.*" --exclude="iczech.*" --exclude="idanish.*" --exclude="idutch.*" --exclude="iesperanto.*" --exclude="ifaroesev.*" --exclude="ifinnish.*" --exclude="igaelic.*" --exclude="igalician-minimos.*" --exclude="ihungarian.*" --exclude="iiimf.*" --exclude="iirish.*" --exclude="iitalian.*" --exclude="ilithuanian.*" --exclude="illuminator-demo.*" --exclude="imanx.*" --exclude="ingerman.*" --exclude="inorwegian.*" --exclude="installation-guide-alpha.*" --exclude="installation-guide-powerpc.*" --exclude="iogerman.*" --exclude="ipolish.*" --exclude="irussian.*" --exclude=".*-is_.*" --exclude="iswedish.*" --exclude="iswiss.*" --exclude=".*-it_.*" --exclude="iukrainian.*" --exclude=".*-ja_.*" --exclude="k6_2.*" --exclude="k6_3.*" --exclude="k7_2.*" --exclude="k7_3.*" --exclude="k7-smp.*" --exclude="kde-i18n.*" --exclude="kdelibs4-.*" --exclude="kernel.*-arm.*" --exclude="kernel.*-mips.*" --exclude="kernel.*-s390.*" --exclude="kernel-.*-speakup_.*" --exclude="khangman.*" --exclude=".*-km_.*" --exclude=".*-ko_.*" --exclude="koffice-doc.*" --exclude="koffice-i18n-.*" --exclude=".*-korean-.*" --exclude="latex-cjk-chinese.*" --exclude="latex-cjk-thai.*" --exclude="libatlas.*" --exclude="libcanna.*" --exclude="libsword4.*" --exclude="libthai.*" --exclude=".*-lt_.*" --exclude=".*-lv_.*" --exclude="manpages-.*" --exclude="med-.*" --exclude=".*-mk_.*" --exclude=".*-mn_.*" --exclude=".*-ms_.*" --exclude="myspell-.*" --exclude="nabi.*" --exclude=".*-nb_.*" --exclude=".*-nds_.*" --exclude=".*-nl_.*" --exclude=".*-nn_.*" --exclude="openoffice.org-dev.*" --exclude="openoffice.org-dev-doc.*" --exclude="openoffice.org-l10n-.*" --exclude="oskit.*" --exclude=".*-pa_.*" --exclude="pango-libthai.*" --exclude="perl-debug.*" --exclude="picon-.*" --exclude=".*-pl_.*" --exclude="prc-tools.*" --exclude=".*-pt_.*" --exclude=".*-pt-br_.*" --exclude="rmligs-german.*" --exclude=".*-ro_.*" --exclude=".*-ru_.*" --exclude=".*-rw_.*" --exclude="samba-doc_.*" --exclude="scim-chinese.*" --exclude="scim-thai.*" --exclude=".*-se_.*" --exclude=".*-sk_.*" --exclude=".*-sl_.*" --exclude=".*-sr_.*" --exclude=".*-srlatin_.*" --exclude=".*-ss_.*" --exclude="stardict.*" --exclude=".*-sv_.*" --exclude="sword-comm-.*" --exclude="sword-dict-.*" --exclude="sword-text-.*" --exclude=".*-ta_.*" --exclude=".*-tg_.*" --exclude="thailatex.*" --exclude="thai-system.*" --exclude=".*-tr_.*" --exclude="treelang-.*" --exclude="ttf-.*" --exclude="ttf2pt1-chinese.*" --exclude="tuxpaint.*" --exclude=".*-uk_.*" --exclude=".*-uz_.*" --exclude="verse.*" --exclude="xfonts-a12k.*" --exclude="xfonts-ay.*" --exclude="xfonts-baekmuk.*" --exclude="xfonts-biznet.*" --exclude="xfonts-bolkhov.*" --exclude="xfonts-cmex.*" --exclude="xfonts-cronyx.*" --exclude="xfonts-cyrillic.*" --exclude="xfonts-encodings.*" --exclude="xfonts-intl-arabic.*" --exclude="xfonts-intl-asian.*" --exclude="xfonts-intl-chinese.*" --exclude="xfonts-intl-japanese.*" --exclude="xfonts-kaname.*" --exclude="xfonts-kappa.*" --exclude="xfonts-marumoji.*" --exclude="xfonts-mplus.*" --exclude="xfonts-naga.*" --exclude="xfonts-shinonome.*" --exclude="xfonts-thai.*" --exclude="xiterm+thai.*" --exclude="xlibmesa-dri-dbg.*" --exclude="xmanpages-ja.*" --exclude="xpdf-chinese.*" --exclude="zh-autoconvert.*" --exclude=".*-zh-cn_.*" --exclude="zhconf.*" --exclude="zh-sgmltools.*" --exclude=".*-zh-tw_.*" --include="bc_.*" --include="dict-freedict-eng-fra.*" --include="dict-freedict-eng-spa.*" --include="dict-freedict-fra-eng.*" --include="dict-freedict-spa-eng.*" --include="doc-linux-fr.*" --include="kde-i18n-es_.*" --include="koffice-i18n-es.*" --include="libgtk*" --include="manpages-es.*" --include="manpages-fr.*" --include="myspell-es.*" --include="myspell-fr.*" --include="openoffice.org-l10n-es.*" --include="ttf-bitstream-vera.*" --include="ttf-dejavu.*" --include="ttf-dustin.*" --include="ttf-f500.*" --include="ttf-freefont.*" --include="ttf-isabella.*" --include="ttf-junicode.*" --include="ttf-opensymbol.*" --include="ttf-staypuft.*" --include="ttf-xfree86.*" --ignore-small-errors --ignore-release-gpg --ignore-missing-release -v -p --cleanup' function reflejos { eval "debmirror $espejo $host $method $root $dist $arch $section $source $modif" } # # echo "-·-·-·- status $?" # Presenta por orden de tamaño los 100 archivos más grandes del espejo. # # function presenta { echo -e "\nLos cien archivos más grandes del espejo:\n" ( eval " echo 'Bloques de 1024 bytes|Nombre del paquete'; ls -R1s $espejo/pool/ | grep '\.deb' | sed -e 's/^ *//g' | sort -t ' ' -k 1 -g -r | head -100 | sed -e 's/ /|/g' " ) | column -t -s"|" mirate=`du -sh "$espejo"` echo -e "\nOcupación del espejo en $espejo:\n$mirate" [ "$total" = "" ]&&total="$mirate"||total="$total \n$mirate" echo -e "\n = = = = = = = = = = = = = = = = = = = = =\n" } # # # # # # # # # # # # # # # # # # # # Genera espejo para SID y SARGE # # # # # # # # # # # # # # # # # # # # # reflejos&&presenta # # # # # # # # # # # # # # # # # # # # Definición de espejo para SECURITY # # # # # # # # # # # # # # # # # # # # # espejo='/repositorio/debian_sec' host='--host=security.debian.org' root='--root=/debian-security' dist='-d sarge/updates' # # # # # # # # # # # # # # # # # # # # Genera espejo para SECURITY # # # # # # # # # # # # # # # # # # # # # reflejos&&presenta echo -e "Espacio ocupado por los repositorios:\n$total\n\n" observa=`df -h /dev/hdc` echo -e "Estado del disco:\n$observa\n\n" echo -e "Fin de la actualización:`date`\n\n" # # # FIN # Buscar el tamaño de unos paquetes concretos: # paquete="picon-*" # for i in `find /repositorio/debian/pool/ -type f -iname "$paquete" -print | xargs ls -ls | sed -e 's/^ *//g' | cut -d" " -f1` # do a=$((a+i)) # done # echo $a = $((a/1024))kB