How to delete all temp and waste files !! ?

rahulw

Verified User
Joined
Sep 3, 2006
Messages
39
Hello All ,


My VPS is allmost full of hard disk space , kindly let me know how can i delete all logs , temp files , and waste dump file from my System , in order to free some space.

It wont be out of place to mention here that , i have never ever cleaned my system, so i hope there must be alot of temp files , using up the space !

Kindly let me know the commands , which will help me to free space !

Thanks in Advance

 
If you have log-bin set in your mysql configuration, then there should be some huge files is /var/lib/mysql. Logs are in the /var/log direcoty, but I don't think that it's taking very much of your space.

Enter to the directory with command "cd directory" and list everything with "du -csh *".
 
If you have log-bin set in your mysql configuration, then there should be some huge files is /var/lib/mysql. Logs are in the /var/log direcoty, but I don't think that it's taking very much of your space.

Enter to the directory with command "cd directory" and list everything with "du -csh *".



yeah , i got this info ...

Code:
[root@ns1 mysql]# ls -l
total 46404
drwx------  2 mysql mysql     8192 May 30 11:13 freeho
drwx------  2 mysql mysql     4096 May 14 13:20 freehost_hcl
drwx------  2 mysql mysql     4096 May 14 13:20 freehost_re
drwx------  2 mysql mysql     4096 May 23 11:38 freehost_r
drwx------  2 mysql mysql     8192 May 14 13:20 freehost_st
drwx------  2 mysql mysql    12288 May 14 13:20 freehost_vii
drwx------  2 mysql mysql     8192 May 14 13:20 freehost_xxx
drwx------  2 mysql mysql    12288 May 30 16:17 hmasala_ipb
drwx------  2 mysql mysql    12288 May 14 13:21 homeo_paid
drwx------  2 mysql mysql    12288 May 14 13:21 homeo_supp
drwx------  2 mysql mysql     4096 May 14 13:21 hyip_ann
-rw-rw----  1 mysql mysql  5242880 May 28 12:41 ib_logfile0
-rw-rw----  1 mysql mysql  5242880 Oct 22  2006 ib_logfile1
-rw-rw----  1 mysql mysql 10485760 May 28 12:41 ibdata1
drwx------  2 mysql mysql     4096 May 28 17:06 invis
drwx------  2 mysql mysql     4096 May 14 13:21 invisio
drwx------  2 mysql mysql     4096 May 14 20:27 invisi
drwx------  2 mysql mysql     4096 May 14 20:27 invisi
drwxrwxrwx  2 mysql mysql 22409216 Jun  2 15:24 invisi
drwx------  2 mysql mysql     4096 May 14 18:50 invisio
drwx------  2 mysql mysql    12288 May 14 18:50 invi
drwx--x--x  2 mysql mysql     4096 May 14 18:50 mysql
srwxrwxrwx  1 mysql mysql        0 May 28 12:41 mysql.sock
-rw-rw----  1 mysql root   3895225 Jun  2 00:10 ns
-rw-rw----  1 mysql mysql        6 May 28 12:41 ns1.
drwx------  2 mysql mysql    16384 May 29 12:14 phpb
drwx------  2 mysql mysql     4096 May 14 18:50 smart_data
drwxr-xr-x  2 mysql mysql     4096 Oct 22  2006 test
drwx------  2 mysql mysql     4096 May 14 18:50 torrent
drwx------  2 mysql mysql     8192 May 14 18:50 wdd


shall i remove all files from here ??

Code:
rm *.*
?? ?

i hope it will not effect database's
 
Code:
[root@ns1 mysql]# du -csh *.*
0       mysql.sock
3.8M    ns1.hosting.com.err
4.0K    ns1.hosting.com.pid
3.8M    total
 
You can remove "ib_logfile0", "ibdata1" and "ib_logfile1".

P.S. use "du -csh *" and not "du -csh *.*" to see the whole directory.
 
You can remove "ib_logfile0", "ibdata1" and "ib_logfile1".

P.S. use "du -csh *" and not "du -csh *.*" to see the whole directory.



i removed all 3 files,
plz let me know where are other temp files kept ... which take space :rolleyes:
 
see this

so much logs :eek:

Code:
[root@ns1 log]# du -csh *
4.0K    audit
8.0K    boot.log
4.0K    boot.log.1
4.0K    boot.log.2
8.0K    boot.log.3
12K     boot.log.4
756K    cron
788K    cron.1
564K    cron.2
396K    cron.3
788K    cron.4
1.3M    directadmin
0       dmesg
8.3M    exim
231M    httpd
152K    lastlog
4.0K    mail
20K     maillog
8.0K    maillog.1
12K     maillog.2
12K     maillog.3
12K     maillog.4
56K     messages
48K     messages.1
24K     messages.2
864K    messages.3
72K     messages.4
708K    proftpd
4.0K    samba
16K     secure
4.0K    secure.1
8.0K    secure.2
12K     secure.3
8.0K    secure.4
0       spooler
0       spooler.1
0       spooler.2
0       spooler.3
0       spooler.4
8.0K    wtmp
116K    wtmp.1
0       yum.log
246M    total
 
Only 246MB, is it too much for you? (I don't think so, but if it is, enter the httpd directory and delete everything except domains directory, because it's needed for DirectAdmin)
 
Only 246MB, is it too much for you? (I don't think so, but if it is, enter the httpd directory and delete everything except domains directory, because it's needed for DirectAdmin)



Code:
[root@ns1 domains]# du -csh *


59M     xxx.com.bytes
2.2M    xxx.com.error.log
2.5M    xxx.com.error.log.1
73M     xxx.com.log
95M     xxx.com.log.1

231M    total
[root@ns1 domains]#



can i delete these in "domains" directory ? or how can i flush them :confused:
 
You can do "rm -rf /var/log/httpd/domains/*error.log*", but nothing more, because the others are needed for DirectAdmin (as I said).
 
You can do "rm -rf /var/log/httpd/domains/*error.log*", but nothing more, because the others are needed for DirectAdmin (as I said).



done ..
do let me know if temporary files are resided some where else :p
so i can free some space..
 
Back
Top