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!