Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| wiki:tipps_und_tricks:repository_rsync [2013/06/26 22:42] – angelegt wikiadmin | wiki:tipps_und_tricks:repository_rsync [2015/04/04 16:54] (aktuell) – [rsync] wikiadmin | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | rsync -av --delete-after ftp5.gwdg.de:: | ||
| + | Wie mache ich mir ein Lokales openSUSE-Repo | ||
| + | ====== rsync ====== | ||
| + | |||
| + | < | ||
| + | |||
| + | ====== FTP ====== | ||
| + | |||
| + | Da nicht alle Firewalls rsync durchlassen bzw. nicht jeder Mirror rsync anbietet, habe ich mich auf die Suche nach Alternativen gmacht | ||
| + | |||
| + | ===== Methode 1 ===== | ||
| + | |||
| + | Ein Skript wurde entwickelt | ||
| + | <file bash sync-updaterepo.sh> | ||
| + | |||
| + | #!/bin/bash | ||
| + | |||
| + | updateurl=" | ||
| + | repodir="/ | ||
| + | architectures=" | ||
| + | logfile="/ | ||
| + | datum=`date +%Y.%m.%d\ %H:%M:%S` | ||
| + | |||
| + | echo $* | grep -iq -e " | ||
| + | |||
| + | if [ " | ||
| + | then | ||
| + | verbose=on | ||
| + | echo " | ||
| + | else | ||
| + | verbose=off | ||
| + | echo " | ||
| + | fi | ||
| + | |||
| + | #verbose=on | ||
| + | |||
| + | |||
| + | logging (){ | ||
| + | |||
| + | case $1 in | ||
| + | " | ||
| + | if [ " | ||
| + | then | ||
| + | echo "`date +%Y.%m.%d\ %H:%M:%S` [ OK ] $2" >> $logfile | ||
| + | fi | ||
| + | ;; | ||
| + | " | ||
| + | echo "`date +%Y.%m.%d\ %H:%M:%S` [ FAIL ] $2" >> $logfile | ||
| + | ;; | ||
| + | " | ||
| + | echo "`date +%Y.%m.%d\ %H:%M:%S` [ LOAD ] $2" >> $logfile | ||
| + | ;; | ||
| + | *) | ||
| + | echo "`date +%Y.%m.%d\ %H:%M:%S` $1" >> $logfile | ||
| + | esac | ||
| + | |||
| + | fehlerauswertung(){ | ||
| + | if [ ! $? = 0 ] | ||
| + | then | ||
| + | logging " | ||
| + | fi | ||
| + | } | ||
| + | |||
| + | if [ ! -e $logfile ] | ||
| + | then | ||
| + | touch $logfile | ||
| + | fi | ||
| + | |||
| + | #Da die Metadaten des Repos bei jeder Änderung neu aufgebaut wird, löschen wir das Verzeichnis repodata | ||
| + | rm -r $repodir/ | ||
| + | |||
| + | logging " | ||
| + | echo -e " | ||
| + | |||
| + | for i in $architectures | ||
| + | do | ||
| + | mkdir -p $repodir/$i > /dev/null 2>&1 | ||
| + | done | ||
| + | |||
| + | |||
| + | for arch in $architectures | ||
| + | do | ||
| + | |||
| + | echo -e "Lade Pakete für \" | ||
| + | logging "begin $arch" | ||
| + | cd / | ||
| + | |||
| + | w3m -dump $updateurl/ | ||
| + | |||
| + | for paket in `cat liste.txt` | ||
| + | do | ||
| + | if [ ! -e $paket ] | ||
| + | then | ||
| + | echo -e "\t[ load ]Lade Paket $paket herunter" | ||
| + | logging " | ||
| + | |||
| + | wget -q $updateurl/ | ||
| + | fehlerauswertung " | ||
| + | |||
| + | elif [ ! -e $paket.md5 ] | ||
| + | then | ||
| + | wget -q $updateurl/ | ||
| + | fehlerauswertung " | ||
| + | |||
| + | if [ -e $paket.md5 ] | ||
| + | then | ||
| + | md5sum -c $paket.md5 >> hashwerte_$arch.txt | ||
| + | fehlerauswertung " | ||
| + | fi | ||
| + | else | ||
| + | echo -e " | ||
| + | logging " | ||
| + | fi | ||
| + | done | ||
| + | |||
| + | rm liste.txt | ||
| + | logging "end $arch" | ||
| + | done | ||
| + | logging "End Copy Repo" | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Methode 2 ===== | ||
| + | |||
| + | Es gibt ein Paket mirror, dass ein paar Perl-Scripte zur Spiegelung enthält | ||
| + | |||
| + | |||
| + | [[http:// | ||
| ====== Quelle ====== | ====== Quelle ====== | ||
| *[[http:// | *[[http:// | ||