Dr. Arne Jachens

Get Weather Forecast

The German weather DWD offers weather prediction data for many towns for free.

To get the data I use wget and wrote the cron job


/usr/bin/wget –no-check-certificate https://opendata.dwd.de/weather/local_forecasts/mos/MOSMIX_L/single_stations/L648/kml/MOSMIX_L_LATEST_L648.kmz -O /var/www/altenstadt.kmz
cd /var/www && /usr/bin/unzip altenstadt.kmz
for f in /var/www/MOSMIX*; do
  mv "$f" /var/www/altenstadt.kml

My /etc/crontab to execute the script to update the weather forecast 4 times per day looks like:


# m h dom mon dow user  command
31 4,10,16,22 * * *     www-data    cd / && run-parts --report /etc/cron.hourly