disk space up to 60%
My disk space has grown from 30% to 60% in the last 3 months.
I can only assume this is from log files in the form of maillogs and squid logs. Any ideas on how to free up the space? I'm pretty sure I have logroate running. I just ran this on the mail log files: cat /dev/null > /var/log/maillog cat /dev/null > /var/log/maillog.1 cat /dev/null > /var/log/maillog.2 cat /dev/null > /var/log/maillog.3 cat /dev/null > /var/log/maillog.4 |
if this isn't a server type:
Code:
sudo rm -rf /var |
Quote:
I have backe dup all /var and /etc files daily so have a record. I cannot reboot due to people using the server. |
do not do those commands on a server! it will mess it up bad!
wait for another response. |
Check for any individual large files.
The following searches for files over 50M in /var Code:
find /var -size +50M Code:
find / -name core [EDIT] Avoid running find on the /proc directory. Code:
find / -path /proc -prune -o -name core -print |
Quote:
|
Hi
If you think it's the logfiles, the proper thing would be to edit the file /etc/logrotate.conf and change it. Standard is usually weekly and rotate is 4 which means rotate the logs weekly and keep 4 weeks of logs. If you change rotate to for example 2 you should free up some disk space. There are also files in /etc/logrotate.d/ which is settings for specific apps. If you find squid or the name of your MTA, those files would be the ones to change. Another tip is to run these commands cd / du -sh * This will take a while, but it will show you what is taking up the space. If you find there's a lot in /var, then cd /var du -sh * This will show what is taking the space in /var, and so on... |
Quote:
These are the core files: Code:
Here are my squid logs: Code:
/var/log/squid/access.log Code:
du -sh * Code:
du -sh * |
Quote:
2.1G sarg in /var/www/ sarg writes html files every day Maybe they shouldn't be in /var at all but they need to be in www to be accessible from the web. |
Hi
I think the proper thing would be to configure sarg properly. I just installed it and looked at the config file. Edit /etc/squid/sarg.conf Find the line lastlog 0 Which means keep all reports forever. Do you really need them forever? I'd change it to something like: lastlog 4 |
Quote:
Find out what in /var is eating all your diskspace. eg. Quote:
Evo2. |
Quote:
Maybe I should keep 5 for the monthly reports. |
Quote:
|
Quote:
What partitions do which and which of them is (are) filling up? The output of df would be helpful here. If the problem is log files/logrotate, there is also an option to compress old log files which may be useful. |
Definitely edit logrotate scripts to gzip old logs as it goes.
That's a start. Next, determine yourself and/or with a mgr how many online logs are required. You could/should back them up to another system or storage media more frequently. Last but not least, use the options in du to find out where the big dirs/files are and think about more backups/removals. My basic cmd is du / |sort -nk1 ie check specified dir and sort by size Do NOT rm those dirs like /var /tmp ... |
All times are GMT -5. The time now is 04:01 PM. |