Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need suggestion
Message
General information
Forum:
Linux
Category:
Other
Title:
Miscellaneous
Thread ID:
00742248
Message ID:
00742885
Views:
13
Hi Winan,

To find out how much free space I have on my linux system, I do the disk free command:

#>df

To see which file are taking up the most space in a directory, I do the list command as follows:

#> cd /var/log
#> ls -l

I can list every file on the system with the following command. This cammand can take a while to run.

#> ls -R

The log files you need to delete will depend on the services you are running. For example, MySQL log to the /var/log directory on my system, but since I'm not using MySQL, and I may have it unchecked so the MySQL daemon does not even start, are all zero length. I use postgres as my database and it log everything to system databases, so this is where I need to focus if I want to cleanup old postgres log entries.

Some file log to their own directories just below the log tree. For example, if your running apache and you have logging enabled for access and http error or warnings, etc, the log files are in /var/log/httpd.

Here are some logs I would consider for cleaning:

boot.log
cron
messages
ksyms
maillog
wtmp
lastlog
squid #If your still using it
files in /var/log/httpd
mysql log files
/var/account/pacct If you have process accounting on.

You might pull up the manual pages on the logrotate command. It might be useful to you in building your cron jobs to cleanup logs.

Also, an easy way to wipe a log clean is to use the cat command like:

#> cat /dev/null > /var/log/messages

The above command would bring the messages file back to zero bytes.

LelandJ
Leland F. Jackson, CPA
Software - Master (TM)
smvfp@mail.smvfp.com
Software Master TM
Previous
Reply
Map
View

Click here to load this message in the networking platform