Cron / feature for cleaning logs?

3 posts / 0 new
Last post
#1 Tue, 12/29/2015 - 05:18
marceld202

Cron / feature for cleaning logs?

Hi,

I often face the problem that my log files are getting incredable huge. So huge even that it eats up all my disk space and I get an error 'no space left on device'.

I now clean the logs manually every now and then by: - Deleting all log files ending with .gz - Emptying all other log files

I would like to automate this and I was thinking maybe virtualmin/webmin has a feature supporting this easily. I can of course create an sh file to do the removes and call it via cron, but I`m not very good with this so hopefully there is a more easy solution.

Thanks in advance!

Thu, 12/31/2015 - 20:45
scotwnw

In webmin, go to system>log file rotation. Then "add a new log file to rotate" Set when to rotate or Set max size of log before it rotates. Then et max number of logs to keep.

Will create new log as needed and delete old ones as they age out.

Sat, 01/02/2016 - 05:11
marceld202

Thanks!

So I now setup rotating with these global settings: Maximum size before rotating set to 10485760 (=10mb) Minimum size before rotating set to 8388608 (= 8mb) Number of logs to keep set to 2 truncate log file in place set to Default (No)

One question, what does truncate log file in place mean? This is now set to No. When should I set this to yes?

Topic locked