Logrotate

Grant Peel gpeel at thenetnow.com
Sun Jan 23 14:10:22 UTC 2011


Hi all,

Not sure if there is a better list to ask this, so here goes.

I use logrotate to rotate the apache log files within each domains log 
directory. They are in the home directory as such:

/home/domain1.com/logs/access_log
/home/domain2.com/logs/access_log
/home/domain3.com/logs/access_log
...

In the home directory, I also have symlinks that point to specific domain 
directories, example

cd /home

domain1.ca -> domain1.com
domain1.net -> domain1.com
domain1.org -> domain1.com
someothername.com -> domain1.com
...

All this have beein said, when I use logrotate, it rotates the logs within 
the directories that have sym links pointing to them over and over again. In 
the case of domain1.com, the log would be rotated 5 times.

I am using a logrotate.conf container that looks like so:

# more logrotate.conf
...
/home/*/logs/access_log {
        missingok
        rotate 14
        daily
        create 644 root
                }
...

So, obviously because I am using a wildcard within the container logrotate 
is going through the symlinks and rotating the logs over and over.

Is there a way or method to ignore the symlinks (or a workaround) that 
anyone knows of, other than making a logrotate.conf container for each 
individal directory.

Thanks all,

-Grant 



More information about the freebsd-questions mailing list