[root@was01 home]# cat cut_nginx_log.sh
http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
#!/bin/bash
logs_path="/nginx/log/"
log_name="access.log"
pid_path="/nginx/run/nginx.pid"
mv ${logs_path}access.log ${logs_path}access_$(date -d "yesterday" +"%Y%m%d").log
kill -USR1 `cat ${pid_path}`
http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
crontab 设置作业http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
http://www.cndba.cn/hbhe0316/article/4842
0 0 * * * bash /nginx/cut_nginx_log.sh
版权声明:本文为博主原创文章,未经博主允许不得转载。
nginx