From aeb145811a9765b31c7120fcdf8e3b982192bbe4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 24 Sep 2012 16:43:10 +0200 Subject: Pfade angepasst an die neue Verzeichnisstruktur des OSM main mirrors. --- bin/sync-osm-planet.sh | 65 ++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/bin/sync-osm-planet.sh b/bin/sync-osm-planet.sh index df9b538..356af40 100755 --- a/bin/sync-osm-planet.sh +++ b/bin/sync-osm-planet.sh @@ -1,7 +1,7 @@ #!/bin/bash RSYNC="/usr/bin/rsync" -SRC="rsync://planet.openstreetmap.org/planet/" +SRC="rsync://planet.openstreetmap.org/planet/planet/" DST="/mirror/ftp/pub/openstreetmap/" RSYNC_OPTS=( "-Hax" @@ -13,7 +13,9 @@ RSYNC_OPTS=( "--include=*-$(date -d '-3month' +%y%m)*" "--include=*-latest*" "--exclude=*" - "--filter=protect torrents/" ) + "--filter=protect torrents/" + #"--list-only" + ) MKTORRENT="/usr/bin/mktorrent" TRACKER=( @@ -23,36 +25,37 @@ TRACKER=( MKTORRENT_OPTS=( "-l 22" ) ${RSYNC} "${RSYNC_OPTS[@]}" ${SRC} ${DST} +${RSYNC} "${RSYNC_OPTS[@]}" "${SRC}/$(date +%Y)/" "${DST}/$(date +%Y)/" # create torrents -for file in ${DST}/*.bz2 -do - archiv="$(basename $file)" - if [ ! -L ${file} ] - then - torrent="${DST}/torrents/${archiv}.torrent" - torrent_tmp="/tmp/${archiv}.torrent" - - if [ ! -e "${torrent}" ] - then - rm -f "${torrent_tmp}" - - TRACKER_OPT="" - for t in "${TRACKER[@]}" - do - TRACKER_OPT="${TRACKER_OPT} -a ${t}" - done - - ${MKTORRENT} ${TRACKER_OPT} "${MKTORRENT_OPTS[@]}" \ - -w "http://ftp.spline.inf.fu-berlin.de/pub/openstreetmap/${archiv}" \ - -w "http://planet.osm.org/${archiv}" \ - "${file}" -o "${torrent_tmp}" > /dev/null && \ - mv "${torrent_tmp}" "${torrent}" - fi - else - target="$(readlink ${file})" - ln -sf "$(basename ${target}).torrent" "${DST}/torrents/${archiv}.torrent" - fi -done +#for file in ${DST}/*.bz2 +#do +# archiv="$(basename $file)" +# if [ ! -L ${file} ] +# then +# torrent="${DST}/torrents/${archiv}.torrent" +# torrent_tmp="/tmp/${archiv}.torrent" +# +# if [ ! -e "${torrent}" ] +# then +# rm -f "${torrent_tmp}" +# +# TRACKER_OPT="" +# for t in "${TRACKER[@]}" +# do +# TRACKER_OPT="${TRACKER_OPT} -a ${t}" +# done +# +# ${MKTORRENT} ${TRACKER_OPT} "${MKTORRENT_OPTS[@]}" \ +# -w "http://ftp.spline.inf.fu-berlin.de/pub/openstreetmap/${archiv}" \ +# -w "http://planet.osm.org/${archiv}" \ +# "${file}" -o "${torrent_tmp}" > /dev/null && \ +# mv "${torrent_tmp}" "${torrent}" +# fi +# else +# target="$(readlink ${file})" +# ln -sf "$(basename ${target}).torrent" "${DST}/torrents/${archiv}.torrent" +# fi +#done echo "End: $(date)" -- cgit v1.2.3-1-g7c22