Logrotate does not work on Ubuntu 14.0.4

I installed Logrotate on my system. My log file name is similar to: log-2015-09-09.php Here is my configuration in etc / logrotate.conf:

/home/root/php/www/myProject/CI/application/logs/log-%Y-%m-%d.php{
        daily
        size 1K
        copytruncate
        compress
        rotate 1
        notifempty
        missingok
}

When I check the status using:

cat /var/lib/logrotate/status

He did not show me anything about my logs, nor did he delete or compress my log files. Something is wrong in my configuration that I need to change.

+4
source share
1 answer

I would suggest that the reason for this is the directory / file name. I'm not sure what you associate with %there, but you can use wildcards, for example:

/home/root/php/www/myProject/CI/application/logs/log-*.php {
    daily
    size 1K
    copytruncate
    compress
    rotate 1
    notifempty
    missingok
}

You can also check the logarithm with:

logrotate -d -f /etc/logrotate.conf

-d = , .

-f = , ,

0

Source: https://habr.com/ru/post/1608669/


All Articles