-
Notifications
You must be signed in to change notification settings - Fork 2
UpdateMaxMindDB
dlage edited this page Jun 1, 2013
·
1 revision
- summary Example on how to update the Maxmind GeoLocation Databases
As stated on [http://www.maxmind.com/app/ip-location MaxMind] site the databases are usually updated monthly, on the 1st of the month.
You can configure a cron job to update the database. Following is an example of a script you can use to update the database files.
Choose the database files you need to use for your sites.
cd /usr/local/share/GeoIP wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz gunzip -c GeoLiteCity.dat.gz > GeoLiteCity.dat gunzip -c GeoIP.dat.gz > GeoIP.dat gunzip -c GeoIPv6.dat.gz > GeoIPv6.dat
Explanation:
wget:
- -N flag only downloads if the file is newer than the one on the target folder
- -q flag means quiet
gunzip:
- -c prevents the gz file of being deleted (so wget doesn't download if there is no newer file)