Follow these instructions to install geoipupdate: https://github.com/maxmind/geoipupdate#installing-on-ubuntu-via-ppa
Install ./jq
:
$ sudo apt install jq
Install mmdbinspect
:
sudo curl -LJO https://github.com/maxmind/mmdbinspect/releases/download/v0.1.1/mmdbinspect_0.1.1_linux_amd64.deb && sudo dpkg -i mmdbinspect_0.1.1_linux_amd64.deb
Script geoip
:
$ touch /sbin/geoip
$ nano /sbin/geoip
$ chmod +x /sbin/geoip
Script update_dbip
:
$ touch /opt/geoip/update_dbip
$ nano /opt/geoip/update_dbip
$ chmod +x /opt/geoip/update_dbip
Script update_geoip
:
$ touch /opt/geoip/update_geoip
$ nano /opt/geoip/update_geoip
$ chmod +x /opt/geoip/update_geoip
Run $ sudo crontab -e
And add these to the crontab
00 7 * * * /opt/geoip/update_dbip no >> /opt/geoip/logs/`date +\%m-\%d-\%Y`-update_dbip.log 2>&1
00 7 * * * /opt/geoip/update_geoip >> /opt/geoip/logs/`date +\%m-\%d-\%Y`-update_geoip.log 2>&1