Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: Leo on April 07, 2020, 10:46:02 AM

Title: How to rotate access logs
Post by: Leo on April 07, 2020, 10:46:02 AM
I have just noticed that my hard drive has been running out of space. Checking what's bloating the drive, I've found out that one of the access logs has become 7 GB's, accumulating data for months.

Is there a way to clear these logs on a, say, monthly basis? That's what the rotate system does, right? How do I go about it? I have noticed that there is a Logrotate manager section in the CWP control panel but I don't know how to configure it. It'd be better if that page was designed more user friendly. It should be like configuring a backup, select which log to rotate, select interval (week/month etc) and hit Submit.
Title: Re: How to rotate access logs
Post by: ejsolutions on April 07, 2020, 10:50:17 AM
Very easy to do on the command line- especially if you read the docs/man pages! Come out of the Windoze/Mac buuble.  :o
/etc/logrotate.conf
/etc/logrotate.d/

Clue 1: compress
Clue 2: Size 2M
Title: Re: How to rotate access logs
Post by: ejsolutions on April 07, 2020, 12:17:25 PM
Scrub the above.
Just looked in both free CWP & CWP Pro: couldn't be easier! There's even a cut down man page alongside.
How much spoon feeding does one need? Jeez!