Logrotate configuration not working

Started by changlee, December 06, 2023, 04:07:37 PM

Previous topic - Next topic

changlee

I created the config but when I run it, I get: No such file or directory at every line.

My logs are getting huge. Please advise.
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

rcschaff

You have to put the full path to the log files in the logrotate config.  Please post the contents of that file...
Google Hangouts:  rcschaff82@gmail.com

changlee

I created that file:
# Logrotate CWP
/usr/local/apache/domlogs/*.log {
        compress
        delaycompress
        daily
        missingok
}
/usr/local/apache/logs/*.log {
        compress
        delaycompress
        daily
        missingok
}
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

overseer

Did you create the file manually via a shell or did you use the CWP built-in facility?
https://fornex.com/en/help/logrotate-centos-7/

rcschaff

Your missing the very important part.  You need a "rotate" option for how many files to keep.  Add " rotate 1 " as an option and it might work.
Google Hangouts:  rcschaff82@gmail.com

changlee

I understand nothing. I ask for paid support for a) Updates and b) log space cleaning. I think CWP will need to improve to that.
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

rcschaff

Change your files to:

# Logrotate CWP
/usr/local/apache/domlogs/*.log {
        compress
        delaycompress
        daily
        missingok
        rotate 1
}
/usr/local/apache/logs/*.log {
        compress
        delaycompress
        daily
        missingok
        rotate 1
}
Google Hangouts:  rcschaff82@gmail.com

changlee

Is that official please? Have you tried that? Thanks for the help.
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com

rcschaff

Try it and find out if it works.  But I know that if logrotate doesn't have a number of backups to keep, it will fail.  Hence why all that was added is "rotate 1", which tells it to keep ONLY 1 backup.  If you need more days, increase that number.
Google Hangouts:  rcschaff82@gmail.com