Created
October 20, 2014 13:53
-
-
Save rbraband/cb81602dec33774daea6 to your computer and use it in GitHub Desktop.
Graphhopper weekly update script for Windows Task-Scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF && PUSHD "%~dp0" && SETLOCAL | |
ECHO [%date% - %time%] Log start > download.log | |
SC Stop Graphhopper > nul | |
RENAME europe-latest.osm.pbf old_europe-latest.osm.pbf | |
REM Wget: retrieve files from the WWW http://gnuwin32.sourceforge.net/packages/wget.htm | |
WGET --no-verbose --append-output=download.log --tries=3 http://download.geofabrik.de/europe-latest.osm.pbf | |
IF exist %~dp0\europe-latest.osm.pbf ( | |
ECHO [%date% - %time%] Download successful >> download.log | |
DEL old_europe-latest.osm.pbf | |
PUSHD %~dp0\europe-latest.osm-gh | |
IF errorlevel 0 ( | |
RD /q /s . 2> NUL | |
POPD | |
) | |
SC Start Graphhopper > nul | |
ECHO [%date% - %time%] Log end >> download.log | |
EXIT /b 0 | |
) ELSE ( | |
ECHO [%date% - %time%] Unable to download new osm file, aborting >> download.log | |
RENAME old_europe-latest.osm.pbf europe-latest.osm.pbf | |
SC Start Graphhopper > nul | |
ECHO [%date% - %time%] Log end >> download.log | |
EXIT /b 1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the windows service I used NSSM - the Non-Sucking Service Manager http://nssm.cc/