robert %!s(int64=2) %!d(string=hai) anos
pai
achega
7062cd7f0b
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      nginxlog_cut.sh

+ 7 - 0
nginxlog_cut.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+log_path=/data/log/resin-books/bo/visit
+DATE=$(date +%Y%m%d%H --date='1 hour ago')
+mv $log_path/access.log $log_path/access.log.$DATE
+kill -USR1 `cat /app/soft/nginx/nginx.pid`
+
+find $log_path -type f -name "access.log.*" -mtime +4|xargs rm -f