nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

/tmp clean directory automatically using tmpwatch

This is a discussion on /tmp clean directory automatically using tmpwatch within the Getting started tutorials forums, part of the Linux Getting Started category; is it ok to clean up all directory n files on /tmp? from someone who need a little space cheers, ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 25-03-2007, 04:25 AM
Junior Member
User
 
Join Date: Mar 2007
Location: indonesia
OS: ubuntu
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tanachi
Send a message via Yahoo to tanachi
Default /tmp clean directory automatically using tmpwatch

is it ok to clean up all directory n files on /tmp?

from someone who need a little space

cheers,

chikatambun
Reply With Quote
  #2 (permalink)  
Old 25-03-2007, 02:38 PM
B!n@ry's Avatar
Senior Member
User
 
Join Date: Dec 2006
Location: B!n@ry-z0ne
OS: Ojuba 3
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
B!n@ry
Send a message via MSN to B!n@ry
Default

clean all I think no, becoz some are used by the system and your user.
__________________
LivE Free 0r DiE
L!nux rul3z aLL
Reply With Quote
  #3 (permalink)  
Old 27-03-2007, 09:17 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You may need to use a command called tmpwatch which removes files which haven’t been accessed for a period of time. Normally, it’s used to clean up directories which are used for temporary holding space such as /tmp.

Following code will remove all files/dirs from /tmp if they are not accessed in last 2 weeks (24 * 14 days = 336)
Code:
tmpwatch --mtime --all 336 /tmp
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #4 (permalink)  
Old 24-05-2007, 03:15 AM
Member
User
 
Join Date: May 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3
lacloai is on a distinguished road
Default Hi

I run tmpwatch command at root, and it's saying "command not found". I am running SuSe10. So, is there a package that I need to install before I can use tmpwatch on SuSe? Please help. Thanks a lot.
Reply With Quote
  #5 (permalink)  
Old 24-05-2007, 10:58 AM
Senior Member
User
 
Join Date: Jun 2005
Posts: 137
Thanks: 21
Thanked 4 Times in 3 Posts
Rep Power: 5
jerry is on a distinguished road
Default

Quote:
Originally Posted by lacloai View Post
I run tmpwatch command at root, and it's saying "command not found". I am running SuSe10. So, is there a package that I need to install before I can use tmpwatch on SuSe? Please help. Thanks a lot.
Use yast/yast2 and install tmpwatch package / rpm
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to start Apache2 automatically at boot satimis Web servers 2 03-02-2008 06:03 PM
run a command automatically after every 10 mins vikas027 Shell scripting 1 01-11-2007 07:24 PM
Automatically restart unix daemon raj Linux software 2 16-12-2006 11:29 AM
Dynamic DNS , should get updates automatically from DHCP sonaikar Linux software 1 28-03-2005 12:14 PM
How to update DNS through DHCP automatically sonaikar Shell scripting 1 16-03-2005 06:42 PM


All times are GMT +5.5. The time now is 03:37 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38