/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. Android 监听器

    Android提供很多种事件监听器,监听器主要是为了相应某个动作,可以通过监控这种动作行为,来完成我们需要的程序功能.      OnItemClickListener:               ...

  2. mini-httpd源码分析-tdate_parse.h

    ///关联字符串和整数 struct strlong { char* s; long l; }; ///将字符串中的大写字母转换成小写字母 static void pound_case(char* s ...

  3. CSS自学笔记(7):CSS定位

    很多时候,我们需要对一些元素进行自定义排序.布局等,这是就需要用到CSS的定位属性了,用这些属性对一些元素进行自定义排序.布局等操作,可以改变浏览器默认的死板的排序. CSS定位的功能很容易理解,它允 ...

  4. 理解C语言声明的优先级规则

    声明从它的名字开始读取,然后依次按优先级依次读取. 优先级从高到低依次是 声明中被括号括起来的那部分 后缀操作符: 括号()表示这是一个函数 方括号表[]这是一个数组 前缀操作符:星号*表示“指向.. ...

  5. charset

    <meta charset="UTF-8" /> 这是html5的写法. <meta http-equiv=“content-type” content=“tex ...

  6. Activity篇章参考

    附上学习这部分知识的时候收集的一些比较好的链接: Task and backStack|Android Developer adb shell dumpsys activity 单个apk多进程 Ac ...

  7. ORACLE视图添加备注

    ORACLE视图添加备注 版权声明:本文为博主原创文章,未经博主允许不得转载. create or replace view oes_material_series_ref as select t.p ...

  8. Oracle EBS-SQL (SYS-4):sys_职责查询.sql

    select t.RESPONSIBILITY_NAME from apps.FND_RESPONSIBILITY_VL t where t.RESPONSIBILITY_NAME like '%MR ...

  9. ViewPager + HorizontalScrollView 实现可滚动的标签栏

    这是一个可滑动的标签栏的自定义控件,参考此文章http://blog.csdn.net/fx_sky/article/details/8990573,我将主要的功能整合成一个类,配上2个特定的布局即可 ...

  10. C# 多线程使用队列注意事项

    问题: 多线程运行时死亡机问题很频繁! 推理: 看源码推理,发现 Queue<T>这样的泛型不是线程安全的. 验证: 将 Queue<T> 换成 Queue 类,并以 lock ...