Chinaunix首页 | 论坛 | 博客
  • 博客访问: 81956
  • 博文数量: 36
  • 博客积分: 835
  • 博客等级: 准尉
  • 技术积分: 380
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-14 09:26
文章分类

全部博文(36)

文章存档

2012年(1)

2011年(35)

我的朋友

分类: LINUX

2011-02-15 11:54:27

**分割NGINX LOG日志
#!/bin/bash
log_dir="/data1/logs/nginx"
time=`date +%Y%m%d`
mv ${log_dir}/access.log ${log_dir}/access.log.$time
kill -USR1 `cat /var/run/nginx.pid`
sleep 1
cd /data1/logs/nginx
tar czvf access.log.$time.tgz access.log.$time
rm -f access.log.$time
阅读(464) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~