Ticket #1725: planet.sh.patch.bittorrent

File planet.sh.patch.bittorrent, 1.8 KB (added by wildduck, 7 years ago)

patch

Line 
1Index: planet.sh
2===================================================================
3--- planet.sh   (Revision 21761)
4+++ planet.sh   (Arbeitskopie)
5@@ -4,7 +4,9 @@
6 cur_planet=planet-${cur_date}.osm
7 cur_relation=relations-${cur_date}.osm
8 planet_dir=/var/www/planet.openstreetmap.org/
9+mk_torrent=./mktorrent/mktorrent
10 
11+
12 export PATH='/usr/local/bin:/usr/bin:/bin:/usr/bin/X11'
13 
14 cd ${planet_dir}
15@@ -23,6 +25,11 @@
16 md5sum ${cur_planet}.bz2 > ${cur_planet}.bz2.md5
17 md5sum ${cur_relation}.bz2 > ${cur_relation}.bz2.md5
18 
19+
20+#make torrents for current planet file and current relation file
21+$mk_torrent -a http://denis.stalker.h3q.com:6969/announce ${cur_planet}.bz2
22+$mk_torrent -a http://denis.stalker.h3q.com:6969/announce ${cur_relation}.bz2
23+               
24 #7zr a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on  planet-`date +%y%m%d.osm`.7z  ${cur_planet}
25 #chmod a+r ${cur_planet}.7z
26 #mv ${cur_planet}.7z ${planet_dir}
27@@ -36,6 +43,21 @@
28 sed -e "s/${cur_planet}.bz2/planet-latest.osm.bz2/" ${cur_planet}.bz2.md5 > planet-latest.osm.bz2.md5
29 sed -e "s/${cur_relation}.bz2/relations-latest.osm.bz2/" ${cur_relation}.bz2.md5 > relations-latest.osm.bz2.md5
30 
31+#remove old torrents for planet-latest.osm.bz2 and relations-latest.osm.bz2
32+
33+rm planet-latest.osm.bz2.torrent
34+rm relations-latest.osm.bz2.torrent
35+
36+#make torrents for  planet-latest.osm.bz2 file and relations-latest.osm.bz2
37+
38+$mk_torrent -a http://denis.stalker.h3q.com:6969/announce planet-latest.osm.bz2
39+$mk_torrent -a http://denis.stalker.h3q.com:6969/announce relations-latest.osm.bz2
40+
41+#remove all torrents from transmission and start seeding all new torrents
42+
43+transmission-remote -tall -r
44+for f in *.torrent; do transmission-remote -a "$f"; done
45+
46 #next, create the planet diff from last week to this week
47 
48 CURPLANETDATE=`echo ${cur_planet}|sed -e 's/\w*-\([0-9]*\).*/\1/'`