Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Logrotate not working with Nginx

$
0
0
Hello,

I don't kown if this will help but I don't use logrotate with nginx.

I use a script scheduled in crontab root who do the job.

The script :

retention=7
log="/applis/nginx/logs"
pid="$log/nginx.pid"

mv $log/access.log $log/access.log.$(date +%Y%m%d)
mv $log/error.log $log/error.log.$(date +%Y%m%d)
kill -USR1 `cat $pid`

find $log/ -type f -name "*.log.*" -mtime +$retention -exec rm -f {} \+

Viewing all articles
Browse latest Browse all 4759

Trending Articles