Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • Differenze per "GruppoTest/Iso/Rsync"
Differenze tra le versioni 2 e 3
Versione 2 del 09/12/2009 22.28.03
Dimensione: 5727
Commento:
Versione 3 del 10/12/2009 12.36.03
Dimensione: 5999
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 7: Linea 7:
'''rsync''' is a wonderful piece of software that only downloads the parts of a file that have changed. https://launchpad.net/products/rsync is a good resource for more information. '''rsync''' è un fantastico programma che scarica le parti di un file che sono cambiate nel server. Il sito https://launchpad.net/products/rsync è una buona risorsa di informazioni.
Linea 9: Linea 9:
A nice thing about the way the Ubuntu CDs are constructed is that it's quite easy to keep an up to date local install CD using rsync. Since the daily CDs generally change quite little, it can be processed quite quickly. Una cosa molto bella riguardo come vengono create le immagini dei CD di Ubuntu è che con rsync è facile tenere una copia locale aggiornata. Dato che le immagini giornaliere cambiano di solito solo in minima parte, il processo può essere abbastanza veloce.
Linea 11: Linea 11:
= Acquiring the ISO =
The various files that you need are at http://cdimage.ubuntu.com It's best to use the torrent file if you can.
= Ottenere un immagine ISO =
Tutte le immagini dei CD di Ubuntu sono disponibili sul sito http://cdimage.ubuntu.com. Il modo più veloce per scaricarle la prima volta è usando [http://it.wikipedia.org/wiki/BitTorrent Torrent].
Linea 14: Linea 14:
If you have a local Ubuntu archive mirror or cache, you can also use Jigdo. Rsync is handy for finishing up Jigdo downloads that still have a few missing pieces.

= Updating the ISO =
A number of the Ubuntu servers also work as rsync servers with quite similar URIs to the websites. For example:
= Aggiornare l'immagine ISO =
Un certo numero di server Ubuntu fungono anche da serventi rsync con indirizzi simili a quelli del sito web. Ad esempio il comando:
Linea 23: Linea 21:
will sync the server's daily Karmic desktop image (for i386) to your local system with an older desktop image already stored on your hard drive. -z is compression, -hh is human readable file size (in KB or MB), and -P is a progress indicator. sincronizzerà l'immagine giornaliera desktop di Karmic (per la piattaforma i386) con la tua versione locale (il puntino indica il punto corrente della shell). I parametri indicano: -z di usare la compressione, -hh di usare unità di misura facilmente leggibili dall'uomo (Kb, Mb, ecc) e -P indica di mostrare lo stato di progresso.
Linea 25: Linea 23:
'''Note:''' If you are using other flavors of Ubuntu don't forget to add the flavor's name in the rsync path after cdimage/, e.g. '''Nota:''' Se state scaricando un'altra edizione di Ubuntu non dimenticate di indicare il nome dell'edizione nel percorso rsyn subito dopo cdimage/, ad esempio per kubuntu:
Linea 30: Linea 29:
A slightly more advanced script will automate much of the syncing process. To run this script successfully, you will need to set the '''DIR''' variable according to your needs. You can set '''ISO''' inside the script or simply pass it in on the command-line (to make it easier to sync multiple ISO images). In some cases you may need to manually set '''ISOPATH''' if you're downloading an image not automatically detected. Add "#!/bin/bash" on Top of the script (It is there in editing-mode). Esiste poi uno script un po' più avanzato per automatizzare il processo di sincronizzazione. Per eseguire con successo questo script occorre che impostiate la variabile '''DIR''' secondo le vostre esigenze. Potete impostare la variabile '''ISO''' dentro lo script o semplicemente passarla come parametro quando lo invocate a riga di comando (questo per rendere semplice sincronizzare più immagini). In alcuni casi si renderà necessario impostare la variabile '''ISOPATH''' se state scaricando un immagine non rilevata automaticamente. Assicuratevi di avere "#!/bin/bash" nella prima riga dello script.
Linea 124: Linea 124:
This script does three things. First, it creates files containing the MD5SUMs of both the current local and server images, and outputs if the MD5SUMs are identical or not. If they are not identical, it syncs your local ISO image to the most recent ISO image on the Ubuntu servers. It then rechecks the new local MD5SUM and compares it to the server image, and outputs if the MD5SUMs are identical or not. Questo script fa sostanzialmente tre cose. Per primo crea un file contenente il codice di controllo MD5SUM dell'immagine locale e remota e mostra se i due codici sono identici o meno. Se non sono identici significa che nel server è stata aggiornata l'immagine ed inizia la sincronizzazione. Al termine controlla di nuovo il codice MD5SUM e visualizza il risultato.
Linea 126: Linea 126:
= Using zsync instead = = Uso alternativo con zsync =
Linea 128: Linea 128:
zsync is another implementation of the same algorithm that rsync uses, but does not require special software
at the server end. It seems to be more efficient (require less data to be downloaded) for ISO images.
zsync è un'altra implementazione dello stesso algoritmo che usa rsync, ma non richiede software aggiuntivo installato sul server.
Sembra essere anche leggermente più efficiente (richiede meno dati da scaricare) per le immagini ISO.
Linea 131: Linea 131:
To download or update an image with zsync: Per scaricare o aggiornare un immagine con zsync usate il seguente comando:

BR Indice()

Introduzione

rsync è un fantastico programma che scarica le parti di un file che sono cambiate nel server. Il sito https://launchpad.net/products/rsync è una buona risorsa di informazioni.

Una cosa molto bella riguardo come vengono create le immagini dei CD di Ubuntu è che con rsync è facile tenere una copia locale aggiornata. Dato che le immagini giornaliere cambiano di solito solo in minima parte, il processo può essere abbastanza veloce.

Ottenere un immagine ISO

Tutte le immagini dei CD di Ubuntu sono disponibili sul sito http://cdimage.ubuntu.com. Il modo più veloce per scaricarle la prima volta è usando [http://it.wikipedia.org/wiki/BitTorrent Torrent].

Aggiornare l'immagine ISO

Un certo numero di server Ubuntu fungono anche da serventi rsync con indirizzi simili a quelli del sito web. Ad esempio il comando:

rsync -zhhP rsync://cdimage.ubuntu.com/cdimage/daily-live/current/karmic-desktop-i386.iso .

sincronizzerà l'immagine giornaliera desktop di Karmic (per la piattaforma i386) con la tua versione locale (il puntino indica il punto corrente della shell). I parametri indicano: -z di usare la compressione, -hh di usare unità di misura facilmente leggibili dall'uomo (Kb, Mb, ecc) e -P indica di mostrare lo stato di progresso.

Nota: Se state scaricando un'altra edizione di Ubuntu non dimenticate di indicare il nome dell'edizione nel percorso rsyn subito dopo cdimage/, ad esempio per kubuntu:

rsync -zhhP rsync://cdimage.ubuntu.com/cdimage/kubuntu/daily-live/current/karmic-desktop-i386.iso .

Esiste poi uno script un po' più avanzato per automatizzare il processo di sincronizzazione. Per eseguire con successo questo script occorre che impostiate la variabile DIR secondo le vostre esigenze. Potete impostare la variabile ISO dentro lo script o semplicemente passarla come parametro quando lo invocate a riga di comando (questo per rendere semplice sincronizzare più immagini). In alcuni casi si renderà necessario impostare la variabile ISOPATH se state scaricando un immagine non rilevata automaticamente. Assicuratevi di avere "#!/bin/bash" nella prima riga dello script.

#Script for updating individual ISO image at cdimage.ubuntu.com (daily/current versions).
#Orginal script written by Henrik Omma, slightly adjusted by Bert Verhaeghe, then a bit by Victor Van Hee
#Jeremy Yoder made it try to automatically pick an ISOPATH, adapted to karmic by Christian Bangerter

# Change this next line to the directory where your previously downloaded iso image sits.
DIR="/home/USERNAME/Desktop/karmic"

# Choose only one of the iso files below and uncomment it
ISO="karmic-desktop-amd64.iso"
# ISO="karmic-desktop-i386.iso"
# ISO="karmic-alternate-amd64.iso"
# ISO="karmic-alternate-i386.iso"

# Uncomment the line below if you want a different image not listed below
# ISOPATH="cdimage.ubuntu.com/cdimage/LOCATION/current"

# Default ISO to the first command-line parameter
if [ "$1" != "" ]; then
  ISO=$1
fi

if [ "$ISOPATH" = "" ]; then
  if [[ "$ISO" =~ "-desktop-" ]]; then
    ISOPATH="cdimage.ubuntu.com/cdimage/daily-live/current"
  elif [[ "$ISO" =~ "-alternate-" ]]; then
    ISOPATH="cdimage.ubuntu.com/cdimage/daily/current"
  elif [[ "$ISO" =~ "-dvd-" ]]; then
    ISOPATH="cdimage.ubuntu.com/cdimage/dvd/current"
  elif [[ "$ISO" =~ "-netbook-remix-" ]]; then
    ISOPATH="cdimage.ubuntu.com/cdimage/ubuntu-netbook-remix/daily-live/current"
  elif [[ "$ISO" =~ "-server-" ]]; then
    ISOPATH="cdimage.ubuntu.com/cdimage/ubuntu-server/daily/current"
  else
    echo "Unrecognized distribution, set ISOPATH manually"
    exit 1
  fi
fi

if [ ! -d $DIR ]; then
  echo "Sorry, $DIR does not exist"
  exit
fi

cd $DIR

md5sum $ISO | sed -e "s/  / */" > $ISO.md5.local 
# ^ create identical formatted md5sum file from local copy
echo ""
echo "########################################"
echo "# diff'ing MD5SUMs : local <-> server  #"
echo "########################################"

wget -q http://$ISOPATH/MD5SUMS 
grep $ISO MD5SUMS > $ISO.md5.server
rm MD5SUMS
diff -q $ISO.md5.local $ISO.md5.server

if [ ! $? -eq "0" ]; then
        echo ""
        echo "!!! MD5SUMs differ !!!"
        echo "...Performing rsync..."
        echo "###################"
        echo "# rsync iso image #"
        echo "###################"
        rsync -avzhhP rsync://$ISOPATH/$ISO .
else
        echo ""
        echo "MD5SUMs identical -- no need to Rsync"
        echo ""
        exit 0
fi
echo ""
echo "########################################"
echo "# diff'ing MD5SUMs : local <-> server  #"
echo "########################################"

md5sum $ISO | sed -e "s/  / */" > $ISO.md5.local
diff -q $ISO.md5.local $ISO.md5.server

if [ ! $? -eq "0" ]; then
        echo ""
        echo "!!! MD5SUMs differ !!!"
        echo "!!! Rsync failed!  !!!"
else
        echo ""
        echo "MD5SUMs identical"
        echo "SUCCESS!"
fi
echo ""

Questo script fa sostanzialmente tre cose. Per primo crea un file contenente il codice di controllo MD5SUM dell'immagine locale e remota e mostra se i due codici sono identici o meno. Se non sono identici significa che nel server è stata aggiornata l'immagine ed inizia la sincronizzazione. Al termine controlla di nuovo il codice MD5SUM e visualizza il risultato.

Uso alternativo con zsync

zsync è un'altra implementazione dello stesso algoritmo che usa rsync, ma non richiede software aggiuntivo installato sul server. Sembra essere anche leggermente più efficiente (richiede meno dati da scaricare) per le immagini ISO.

Per scaricare o aggiornare un immagine con zsync usate il seguente comando:

zsync http://cdimage.ubuntu.com/daily-live/current/karmic-desktop-amd64.iso.zsync


CategoryComunita