1827882 Members
1152 Online
109969 Solutions
New Discussion

Re: tmp

 
Chakravarthi
Trusted Contributor

tmp

hi,

i'm using linux machine, in this machine every time system boots it doesnt cleanup /tmp area, but this happens in solaris. is there any tunable parameter to enable this.
i feel one solution is put
rm -rf /tmp/* in the startup scripts

is there any other better way to clean up /tmp partition every time system boots???

regards
chakri
7 REPLIES 7
Alexander Chuzhoy
Honored Contributor

Re: tmp

of cours ethere is:
see man tmpwatch
Sivakumar TS
Honored Contributor

Re: tmp


You can check the above command, as well one input for you :

In solaris /tmp is infact mounted on swap filesystem.

But in linux u have a separate /tmp filesystem itself.

With Regards,

Siva.
Nothing is Impossible !
Chakravarthi
Trusted Contributor

Re: tmp

hi,

can you let me know how do use tmpwatch command, basically i want to delete all the files which are not accessed from last one week..

thanks
chakri
Chakravarthi
Trusted Contributor

Re: tmp

is there a way to cleanup /tmp partition every time machine comes up, any other option other than tmpwatch??
Ivan Ferreira
Honored Contributor

Re: tmp

You can add the rm -fr /tmp/* to the /etc/rc.local file. The commands here are executed at startup.

See man tmpwatch for instructions about how to use it, you need to modify the file located in /etc/cron.daily.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Bill Thorsteinson
Honored Contributor

Re: tmp

You can mount tmp from swap using the tmpfs
drive. This generally provides a very fast
/tmp partition. Increase swap appropriately
if needed. Size of the tmpfs is tuneable.

tmpfs based /tmp directories are always
cleared on reboot.



Chakravarthi
Trusted Contributor

Re: tmp

thanks for the responses