Eliminating log backups (.gz)

GoWilkes

Well-Known Member
Sep 26, 2006
488
12
168
cPanel Access Level
Root Administrator
I'm running very low on server storage, so I'm trying to eliminate anything that's not necessary.

I vaguely remember setting something up a long time ago to link /home/user/logs to show log file backups for the account, but I can't think of any time that's ever been used. The times that I do need to look at a log file, I look at same-day or maybe 1 day ago... never a month ago.

I'm not sure if this is a real directory or an alias, but the backups aren't needed at all. Is there a way to eliminate these /home/user/logs directories and prevent the backups from being created at all?
 

ZenHostingTravis

Well-Known Member
PartnerNOC
May 22, 2020
138
44
28
Australia
cPanel Access Level
Root Administrator
Hi @GoWilkes,

A great tool to see where disk space is being used is ncdu

You could null the error_logs but obviously you wouldn't have log information to refer to debug website issues.

Multiple copies of backup files should be stored on different servers.
 
  • Like
Reactions: anoopk350

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,304
1,249
313
Houston
The /home/$user/logs directory can store user log backups if they've chosen (or you've provided them the option) to store archive logs.


ncdu is pretty nice, a lot of times I just go to / and run du -h --max-depth=1 find the largest few directories and descend into those directories and repeat
 

GoWilkes

Well-Known Member
Sep 26, 2006
488
12
168
cPanel Access Level
Root Administrator
I found that I could go to WHM > Tweak Settings > Stats and Logs, and turn off "Archive logs in the user's home directory at the end of each stats run unless configured by the user. " That stopped the default automatic backup for everyone, anyway. It looks like all of the .GZ files were left in place, but at least they're not growing.

I have over 100 accounts, so deleting everything manually is a time consuming pain. How dangerous is it to try to delete all of the .GZ files with:

rm /home/*/logs/*.gz

While we're on the subject, any other suggestions on WHM settings I can change to stop creating unnecessary log files, or to at least limit the size of them? In the same Tweak section, I have everything at default except:

Log rotation size threshold: 10MB
Interval... to retain Exim stats: 1
Days to retain upcp logs: 3

I'm at 99% of my storage, so I'm getting close to desperate :-O