/home/deployuser/deploy/nginx/temp/logs/home.access.log {
  size 100M
  rotate 100 
  nocompress
  daily
  missingok
  notifempty
  sharedscripts
  postrotate
    [ ! -f /home/deployuser/deploy/nginx/temp/logs/nginx.pid ] || kill -USR1 `cat /home/deployuser/deploy/nginx/temp/logs/nginx.pid`
  endscript
}
保存在/etc/logrotate.d/home中,而logrotate是cronjob每天跑的任务。
postrotate部分是rotate之后通知nginx重新打开日志文件以免丢失日志。

nginx access log logrotate配置的更多相关文章

  1. nginx access.log 忽略favicon.ico訪问记录的方法

    favicon.ico 文件是浏览器收藏网址时显示的图标,当第一次訪问页面时.浏览器会自己主动发起请求获取页面的favicon.ico文件.当/favicon.ico文件不存在时,服务器会记录404日 ...

  2. Nginx Access Log日志统计分析常用命令

    Nginx Access Log日志统计分析常用命令 IP相关统计 统计IP访问量 awk '{print $1}' access.log | sort -n | uniq | wc -l 查看某一时 ...

  3. awk技巧 nginx access.log

    1.1 介绍 awk其名称得自于它的创始人 Alfred Aho .Peter Weinberger 和 Brian Kernighan 姓氏的首个字母.实际上 AWK 的确拥有自己的语言: AWK ...

  4. 转 Nginx Access Log日志统计分析常用命令

    Nginx Access Log日志统计分析常用命令Nginx Access Log日志统计分析常用命令IP相关统计 统计IP访问量 awk '{print $1}' access.log | sor ...

  5. resin access.log format配置详解

    The access log formatting variables follow the Apache variables:     %b result content length %D tim ...

  6. 分析nginx access log日志的命令

    统计访问最多的ip 1. tail -n 10000 xxaccess_log | cut -d " " -f 1 |sort|uniq -c|sort -rn|head -10 ...

  7. shell分析nginx access log日志

    统计访问最多的ip1. tail -n 10000 xxaccess_log | cut -d " " -f 1 |sort|uniq -c|sort -rn|head -10 | ...

  8. 利用logrotate切割nginx的access.log日志

    一.新建一个nginx的logrotate配置文件 /var/log/nginx/access.log { daily rotate compress delaycompress missingok ...

  9. shell定时统计Nginx下access.log的PV并发送给API保存到数据库

    1,统计PV和IP 统计当天的PV(Page View) cat access.log | sed -n /`date "+%d\/%b\/%Y"`/p |wc -l 统计某一天的 ...

随机推荐

  1. this指针与function变量--this究竟指向哪里?

    参考文章:<深入浅出 JavaScript 中的 this> http://www.ibm.com/developerworks/cn/web/1207_wangqf_jsthis/ Ja ...

  2. JS中格式化数据保留两位小数

    问题:在JS中格式化数据保留两位小数的函数的多种方法 最好方法: 保留两位好像是这样吧     var   a   =   9.39393;     alert(a.toFixed(2)); 说明: ...

  3. javascript 动态创建表格

    <html> <head> <script> function createTable(rows,lines){ this.rows=rows; this.line ...

  4. 省去路由器,Windows 7 也能做无线AP

    电脑越来越白菜了,很多朋友家里已经有不少于二台电脑了.比方说一台笔记本一台台试机,哪么上网和联机的问题,随之而来了,二台电脑很多人可能会去买一个路由器,事实上,如果你其中一台有二个网卡一个有线一个无线 ...

  5. chromedriver bug

    https://github.com/FuckTheWorld/chromedriver/issues/1145 https://bugs.chromium.org/p/chromedriver/is ...

  6. PostgreSQL的存储系统二:REDOLOG文件存储结构二

    REDOLOG文件里的用户数据和数据文件里的用户数据存储结构相同 几个月前同事给台湾一家公司培训<pg9 ad admin>时,有个学员提及WAL里记录的内容为Query时的SQL语句(比 ...

  7. Windows Server 2012 R2超级虚拟化之六 Hyper-v Replica 2.0和Live migrations

    Windows Server 2012 R2超级虚拟化之六 Hyper-v Replica 2.0和Live migrations 分钟复制选项也是非常有用的.Hyper-V Replica 2.0在 ...

  8. iOS获取手机当前的网络状态

    获取iOS网络状态,目前有两个办法. 1.通过监听手机状态栏的信息. 2.通过使用官方提供的类Reachability. 一.通过手机监听手机状态栏的信息 好处: 1.可以通过苹果的审核上架AppSt ...

  9. leetcode 刷题之路 64 Construct Binary Tree from Inorder and Postorder Traversal

    Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume tha ...

  10. Java面试题之四

     十六.运行时异常与一般异常有何异同 Java提供了两类主要的异常:runtime exception和checked exception. 1.checked exception:这种异常也就是我们 ...