您的位置:首页 > 运维架构 > Linux

centos7 下 安装GeoIP并设置自动更新

2017-12-19 18:08 531 查看
一、设置YUM源

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm[/code] 
二、安装GeoIP

yum -y install GeoIP-update


安装后查看 /etc/cron.weekly目录

cd /etc/cron.weekly/


多了个 geoipupdate 脚本文件,用任务定是执行该脚本可实现定时更新 GeoIP库

三、设置定时任务

vim  /etc/crontab


增加

0 * * * 6 root run-parts /etc/cron.weekly


每周六 0点执行

更新的GeoIP库文件在 /usr/share/GeoIP/ 目录

ll /usr/share/GeoIP/




可以通过查看 geoipupdate,获取 库文件的位置

cat  /etc/cron.weekly/geoipupdate




4000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: