diff options
author | root <root@plopp.spline.de> | 2012-09-24 16:43:10 +0200 |
---|---|---|
committer | root <root@plopp.spline.de> | 2012-09-24 16:43:10 +0200 |
commit | aeb145811a9765b31c7120fcdf8e3b982192bbe4 (patch) | |
tree | ded12557867be842cc5b36f9637ddacca6ae539c | |
parent | 82ce5babfd1132fd6f0100a335913c4c40891bbf (diff) | |
download | mirror-sync-aeb145811a9765b31c7120fcdf8e3b982192bbe4.tar.gz mirror-sync-aeb145811a9765b31c7120fcdf8e3b982192bbe4.tar.bz2 mirror-sync-aeb145811a9765b31c7120fcdf8e3b982192bbe4.zip |
Pfade angepasst an die neue Verzeichnisstruktur des OSM main mirrors.
-rwxr-xr-x | bin/sync-osm-planet.sh | 65 |
1 files 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)" |