Redis logrotate config

Simian picture Simian · Mar 31, 2011 · Viewed 10.9k times · Source

Does anyone have a sample logrotate config for redis? This is what I have so far

/var/log/redis/*.log {
        daily
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                ...
        endscript
}

But I'm not sure what to do on the postrotate step. This is on Ubuntu 10.04 LTS.

Answer

Simian picture Simian · Apr 6, 2011

This will probably suffice:

/var/log/redis/*.log {
       weekly
       rotate 10
       copytruncate
       delaycompress
       compress
       notifempty
       missingok
}