Skip to content

Instantly share code, notes, and snippets.

@ur5us
Created December 2, 2012 03:22
Show Gist options
  • Save ur5us/4186810 to your computer and use it in GitHub Desktop.
Save ur5us/4186810 to your computer and use it in GitHub Desktop.
Update GeoIP db
#!/bin/bash
# crontab -e and add:
# 0 3 * * 3 eval [ `date +\%e` -ge 8 -a `date +\%e` -lt 15 ] && /usr/sbin/update_geoip_db
# update GeoIP every second Wednesday of the month
wget -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz -O - | gunzip > /usr/share/GeoIP/GeoIP.dat.new && mv /usr/share/GeoIP/GeoIP.dat.new /usr/share/GeoIP/GeoIP.dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment