New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Logrotate domlogs

Started by tokar86a, February 19, 2019, 03:02:40 PM

Previous topic - Next topic

tokar86a

Quote from: cwpnz on February 24, 2019, 08:23:48 PM
tokar86a? I created the following conf file for my domlogs folder - hope it helps

"/usr/local/apache/domlogs/*" {
weekly
create 0644 root root
rotate 3
size 10M
dateext
missingok
notifempty
}

Should it not be create 0644 nobody root ??

According to the log that is already there.

cwpnz

Could be for some, I have log files in that directory with root:root

tokar86a

I end up whit this error

error: /etc/logrotate.d/domlog:1 lines must begin with a keyword or a filename (possibly in double quotes)

cwpnz

Read all the previous posts?

tokar86a

#19
Yes and i have not uploaded the file from windows. I have create the config file whit help of: Create a new configuration file.

When i check /usr/local/apache/domlogs

It seems to have roatated the logs. But way give that error?

Netino

Quote from: tokar86a on February 26, 2019, 09:40:26 AM
Yes and i have not uploaded the file from windows. I have create the config file whit help of: Create a new configuration file.

When i check /usr/local/apache/domlogs

It seems to have roatated the logs. But way give that error?

Makes not sense you try to rotate "/usr/local/apache/domlogs/*".
Makes sense you try to rotate only "/usr/local/apache/domlogs/*.log" (or "/usr/local/apache/domlogs/*.bytes") files.
Otherwise you will rotate "*.gz" files already rotated.

tokar86a

Still ends up whit

Operation failed!

error: /etc/logrotate.d/domlog:1 lines must begin with a keyword or a filename (possibly in double quotes)

Netino

Surely you have mistyped some character of that file.
Or you are uploading that file to the server as "binary" mode through you Windows PC.

seascoot

I know this is an old thread, but posting this in case it helps others with the same issue.

I got the error when creating a config file from the CWP user panel "edit content" file link.  It was solved by pasting the directives into Notepad**, going to Edit>EOL Conversion>Unix (LF), saving the file, then uploading in the user panel file manger interface.

If you do this but still see the error you have a syntax issue.