Empty /tmp when shutting down

Robert Vangel robzilla at bur.st
Wed Feb 25 12:16:14 UTC 2004


Yes, the line at the top is merely to make sure that it uses /bin/sh as 
the interpreter.

The cron entry for cron.daily would have /bin/sh as the command to 
execute, and having /etc/cron.daily/* as an argument, so that everything 
gets executed by /bin/sh

Charles Howse wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Wednesday 25 February 2004 05:56 am, Christopher K. Johnson wrote:
> 
>>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
>>
>>Better yet - check out tmpwatch.  And there is a daily cron job which
>>cleans out temporary files more than a certain number of hours old.  See
>>/etc/cron.daily/tmpwatch and edit the times there if you want to delete
>>them sooner.  In any case there is a mechanism to delete old temp files
>>and that is where it is controlled.  So you could do nothing and know
>>that the /tmp files will be deleted in 10 days.
> 
> 
> Interesting thread...I just looked in /etc/cron.daily, and my default tmpwatch 
> file is executable, but doesn't have the shabang line at the top, so it is 
> listed as a plain text file.  Is that normal?
> 
> - -------------------------------------
> /usr/sbin/tmpwatch 240 /tmp
> /usr/sbin/tmpwatch 720 /var/tmp
> for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
>     if [ -d "$d" ]; then
> 	/usr/sbin/tmpwatch -f 720 $d
>     fi
> done
> - -------------------------------------
> 
> - -- 
> Charles Howse
> Jackson, TN
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQFAPJFW/S+VsB9RMKgRAk46AJ4/Inwarpt9vx5o99O/7cAeeGP6mQCeI5Qa
> sODQpvm9SUq9nRzBdROdLJM=
> =0oZ1
> -----END PGP SIGNATURE-----
> 
> 





More information about the users mailing list