Re: Empty /tmp when shutting down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just create a file in /etc/init.d and name it something (tmpclean seems appropriate).

In the file, have:

--------------
#!/bin/sh
#
# Script for cleaning /tmp
#

rm -rf /tmp/* /tmp/.*
--------------

(Don't include the above and below dashes)

In /etc/rc6.d and /etc/rc0.d, create symlinks to this file with an appropraiate number for when you want them to run, ie

# ln -s /etc/init.d/tmpclean /etc/rc0.d/K99tmpclean

and

# ln -s /etc/init.d/tmpclean /etc/rc6.d/K99tmpclean

This will mean it will be the last (unless there are other K99's in the folders) script to run when the computer is turned off or rebooted.

Coume - Lubox.com wrote:

Hello,

Could you explain me how to create an init script?
Do I just have to copy this line in a tmp.sh file?
rm -rf /tmp/* /tmp/.*

Thxs in advance
Ludo

On Wed, 2004-02-25 at 11:41, Robert Vangel wrote:

You could create a init script in rc6.d and rc0.d which does an

rm -rf /tmp/* /tmp/.*

I don't think it has one built in though

Coume - Lubox.com wrote:

Hello,
Is it possible to empty the /tmp directory when I shutdown my laptop?
If I remember well, I was doing that under MDK but I cannot remember how
:/

Thxs in advance
Ludo
________________________________________________________________
http://www.lubox.com - http://forum.lubox.com
Email Services, How-To (Linux,PHP,...), Freeware...
Come have a look, and you can even drop a msg on the forum!






[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux