1 | #!/bin/bash
|
---|
2 |
|
---|
3 | SOURCE_OPENSUSE="ftp5.gwdg.de::pub/opensuse/"
|
---|
4 |
|
---|
5 | REPOS="repositories/home:/dassit
|
---|
6 | "
|
---|
7 |
|
---|
8 | #
|
---|
9 | # disabled repos:
|
---|
10 | #
|
---|
11 | #distribution/11.2/repo update/11.2 distribution/12.1/repo update/12.1
|
---|
12 |
|
---|
13 | RSYNC_DELETE="--delete"
|
---|
14 |
|
---|
15 | #RSYNC_OPTS="-v -rlLptx --safe-links --stats \
|
---|
16 | # --exclude=*.src.rpm --exclude=*.nosrc.rpm --exclude=*.spm \
|
---|
17 | # --exclude=*.patch.rpm"
|
---|
18 |
|
---|
19 | RSYNC_OPTS="-v -rlLptx --safe-links --stats"
|
---|
20 |
|
---|
21 | DEST="/space/installtree/install/download.opensuse.org"
|
---|
22 |
|
---|
23 | rsync_if_exists()
|
---|
24 | {
|
---|
25 | src=$1
|
---|
26 | dest=$2
|
---|
27 |
|
---|
28 | rsync -q $src || return 1
|
---|
29 | echo rsync-quelle $src gefunden.
|
---|
30 | [ -d "$dest" ] || return 2
|
---|
31 | rsync $RSYNC_OPTS $RSYNC_DELETE $src ./$dest
|
---|
32 | }
|
---|
33 |
|
---|
34 | # ---------------- mirror openSUSE repositories ------------------------
|
---|
35 | FAILED_REPOS=""
|
---|
36 | SUCCESSFUL=""
|
---|
37 |
|
---|
38 | cd $DEST
|
---|
39 |
|
---|
40 | for DIR in $REPOS
|
---|
41 | do
|
---|
42 | SOURCE_DIR=${SOURCE_OPENSUSE}/${DIR}/.
|
---|
43 | DEST_DIR=${DEST}/${DIR}/.
|
---|
44 | mkdir -p ${DEST_DIR}
|
---|
45 | rsync_if_exists "${SOURCE_OPENSUSE}$DIR/" "$DIR"
|
---|
46 | case $? in
|
---|
47 | 1) echo Distribution $DIR nicht gefunden
|
---|
48 | FAILED_REPOS="$FAILED_REPOS $DIR"
|
---|
49 | ;;
|
---|
50 | 2) echo Zielverzeichnis $(pwd)/$DIR nicht vorhanden
|
---|
51 | FAILED_REPOS="$FAILED_REPOS $DIR"
|
---|
52 | ;;
|
---|
53 | 0)
|
---|
54 | SUCCESSFUL="$SUCCESSFUL $DIR"
|
---|
55 | ;;
|
---|
56 | *)
|
---|
57 | echo Fehler $?
|
---|
58 | FAILED_REPOS="$FAILED_REPOS $DIR"
|
---|
59 | ;;
|
---|
60 | esac
|
---|
61 | done
|
---|
62 |
|
---|
63 | # /usr/local/sbin/mirror-report-errors.sh mirror-osb "$SUCCESSFUL" "$FAILED_REPOS"
|
---|
64 | #
|
---|
65 | # # adapt repository sources
|
---|
66 | # for i in `find $DEST/repositories -name "*.repo" -a ! -name "vermkv-*.repo"`; do
|
---|
67 | # basename=`basename $i`
|
---|
68 | # dirname=`dirname $i`
|
---|
69 | # sed "s|http://|http://install.vermkv/freigabe/|" $i > $dirname/vermkv-$basename
|
---|
70 | # done
|
---|
71 |
|
---|