标签:
非常的简单, 主要是留一个记号, 方便以后使用
#!/bin/bash access_path="/usr/local/nginx/logs/" logs_path="/webdata/logs/" mkdir -p ${logs_path}$(date ‘+%y_%m‘)/$(date ‘+%d‘)/ mv ${access_path}access.log ${logs_path}$(date ‘+%y_%m‘)/$(date ‘+%d‘)/access_$(date ‘+%y_%m_%d‘).log kill -USR1 `cat /usr/local/nginx/logs/nginx.pid` /etc/init.d/fastcgi restart
#crontab -l 02 17 * * * /bin/bash /etc/cron.daily/logcut.sh
标签:
原文地址:http://my.oschina.net/harlanblog/blog/411100