Created
June 12, 2010 03:04
-
-
Save aputs/435360 to your computer and use it in GitHub Desktop.
Revisions
-
aputs revised this gist
Jul 5, 2010 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ sharedscripts postrotate FNAME=`echo $1 | sed -e 's/ *$//'`.1 DIR=`dirname $FNAME`/`date --date='-1 day' +%Y%m` EXT=`basename $1 | cut -d'.' -f1` DEST=$DIR/`date --date='-1 day' +%Y%m%d`.$EXT mkdir -p $DIR mv $FNAME $DEST test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` @@ -29,4 +29,4 @@ postrotate test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` endscript } -
aputs created this gist
Jun 12, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ /var/log/nginx_*.log { daily compress delaycompress rotate 2 missingok nocreate sharedscripts postrotate test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` endscript } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ /var/log/php-fpm.log { daily compress delaycompress rotate 2 missingok notifempty create 644 root root sharedscripts postrotate /sbin/service php-fpm flush-logs > /dev/null endscript } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #keep a whole year of logs #rename logs to %Y%m%d/+%Y%m%d.access /var/log/smartwap/access.log { daily nocompress rotate 365 missingok nocreate sharedscripts postrotate FNAME=`echo $1 | sed -e 's/ *$//'`.1 DIR=`date --date='-1 day' +%Y%m` EXT=`basename $1 | cut -d'.' -f1` DEST=`dirname $FNAME`/$DIR/`date --date='-1 day' +%Y%m%d`.$EXT mkdir -p $DIR mv $FNAME $DEST test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` endscript } #error logs /var/log/smartwap/error.log { daily compress delaycompress rotate 2 missingok nocreate postrotate test ! -f /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid` endscript }