ini Linux片段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini Linux片段相关的知识,希望对你有一定的参考价值。

#Cron for Monitoring Daily Referers on Nginx
#This emails you a daily list of referrers using an awk command to exclude domains like google, bing and your own domain name.

00 08 * * * tail -10000 /var/log/nginx/mydomain-access.log | awk '$11 !~ /google|bing|yahoo|yandex|mywebsite.com/' | awk '{print $11}' | tr -d '"' | sort | uniq -c | sort -rn | head -1000 | mail - s "Top 1000 Referers for Mydomain.com" me@mydomain.com

#Cron for Monitoring Daily User Agents on Nginx
#This emails you a list of top User-Agents who visited your site in the last 24 hours, helpful for spotting any rogue or suspicious looking User-Agents strings.

00 08 * * * tail -50000 /var/log/nginx/mydomain-access.log | awk '{print $12}' | tr -d '"' | sort | uniq -c | sort -rn | head -1000 | mail -s "Top 1000 Agents for Mydomain.com" me@mydomain.com

以上是关于ini Linux片段的主要内容,如果未能解决你的问题,请参考以下文章