Automatically updating Maxmind geolite2 database

Create a bash script:
#cat updatedb


echo Updating Maxmind databases:
cd /var/www/virtual/
wget -r
mv ./GeoLite2-City.mmdb.gz

Add a cron file:
#cat geolitecron

# top of crontab
[email protected]

0 23 * * * /var/www/virtual/

# end of crontab

Add it to cron:

crontab geolitecron

That’s it..

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.