LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-01-2008, 03:08 AM   #1
nanda22
Member
 
Registered: Mar 2008
Posts: 58

Rep: Reputation: 15
clean up disk space in SuSE linux


Hi
how to clean up the disk space in linux?

like in windows we use "%temp%" and cleanup all the temp files, the same way how to clean the temp files in linux.

especially how to clean /var and /tmp files
/var is getting filled very often.

please help me

With Regards,
Nanda
 
Old 08-01-2008, 03:31 AM   #2
allez
Member
 
Registered: Jul 2008
Location: Russia/Siberia/Krasnoyarsk
Distribution: SuSE, CentOS, FreeBSD
Posts: 77

Rep: Reputation: 21
Please show here output of the following commands:

df -m
du -sm /var | sort -nr
 
Old 08-01-2008, 04:29 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Look in YaST2.
Click on System -> /etc/sysconfig Editor. Click on Search and enter "TMP". There are several options such as the MAX_DAYS_IN_TMP or CLEAR_TMP_DIRS_AT_BOOTUP which allow you to clear out /tmp in a cron job clearing out old tmp files or to clear out /tmp when you boot up.

Or you can edit /etc/sysconfig/cron directly. You can also add /var/tmp to the list of directories to clear out.

Also check your log rotation setup; /etc/syslog-ng/syslog-ng.conf. This file configures log rotation and how many backups to retain.

Last edited by jschiwal; 08-01-2008 at 04:31 AM.
 
1 members found this post helpful.
Old 08-01-2008, 06:17 AM   #4
nanda22
Member
 
Registered: Mar 2008
Posts: 58

Original Poster
Rep: Reputation: 15
Hi Allez,
Thank you for ur reply.
The following is the output after executing given commands
I've cleared few log files and tmp files, so now the size has subsided.

modis:/home/nanda# df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/sda1 10084 3912 5660 41% /
udev 1014 1 1014 1% /dev
/dev/sda9 297 40 242 15% /boot
/dev/sda13 24214 20415 2569 89% /home0
/dev/sdb1 137815 62222 68593 48% /home1
/dev/sda12 1012 34 927 4% /local
/dev/sda7 8069 1750 5909 23% /opt
/dev/sda10 3027 71 2803 3% /srv
/dev/sda11 2023 76 1846 4% /tmp
/dev/sda5 8069 3818 3841 50% /usr
/dev/sda6 8069 3281 4379 43% /var
modis:/home/nanda # du -sm /var | sort -nr
3135 /var


With Regards,
Nanda
 
Old 08-01-2008, 06:21 AM   #5
nanda22
Member
 
Registered: Mar 2008
Posts: 58

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jschiwal View Post
Look in YaST2.
Click on System -> /etc/sysconfig Editor. Click on Search and enter "TMP". There are several options such as the MAX_DAYS_IN_TMP or CLEAR_TMP_DIRS_AT_BOOTUP which allow you to clear out /tmp in a cron job clearing out old tmp files or to clear out /tmp when you boot up.

Or you can edit /etc/sysconfig/cron directly. You can also add /var/tmp to the list of directories to clear out.

Also check your log rotation setup; /etc/syslog-ng/syslog-ng.conf. This file configures log rotation and how many backups to retain.

Thank You very much jschiwal for your very helpful reply

With Regards,
Nanda

Last edited by nanda22; 05-05-2009 at 12:24 AM.
 
Old 08-01-2008, 06:37 AM   #6
nanda22
Member
 
Registered: Mar 2008
Posts: 58

Original Poster
Rep: Reputation: 15
One more help i need from you
I need to clean few data files which comeup upto some 5-8 GB perday.
Usually i need to keep last two days files and clean up the rest.
So i use the following command to clean up the files

30 1 * * * find /home/nanda/data/archive/2008/AU/*/E.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/AU/*/N.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/AU/*/Z.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/AF/*/E.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/AF/*/N.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/AF/*/Z.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/BA/*/E.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/BA/*/N.D/* -mtime +2 -exec rm {} \;
30 1 * * * find /home/nanda/data/archive/2008/BA/*/Z.D/* -mtime +2 -exec rm {} \;

But the problem here is, you can observe that only AU and AF changed rest of the command is same.
so when i put '*' instead of AU and AF , since the data is in GB's it is not able to remove the data.
it's working only when i give as separate command.
So can you please suggest me any script where i can use any variable instead of 'AU,AF, BA, BC .... etc'.

With Regards,
Nanda
 
  


Reply

Tags
cleanup, disk


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to clean up disk space on /var partition RED HAT jmmo1981 Red Hat 11 02-24-2009 10:38 AM
SUSE 10 Super/Slick Installed and now no disk space spnoe Linux - Software 4 04-03-2006 11:00 AM
Running out of disk space... clean up possible? donv2 Linux - Newbie 3 04-19-2005 03:48 AM
resizing linux partitions to free up space for window$ - safe or clean install? dianat100 Linux - Newbie 5 03-09-2005 01:05 PM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration