Re: cleaning /tmp directory



i need a cron script that cleans every day crap into /tmp
I have there a lot of temp files but i dunno which ones can be safely wiped,
and it is very time comsuming job, too.

There already is a cron that will delete file out of /tmp that are 10 days old.

In addition, at shutdown time everything in /tmp is fair game for
deletion.  As one of the last things done on all my machines I clean out
/tmp.  In my case the reason isn't space, but clutter.  With the default
/tmp cleaning, things build up to such a level that downloaded files
that I only want to look at once are hard to find (such as pdf files
etc).
Put this in /sbin/halt.local mode 755.

#!/bin/sh
###############################################################################
##                                                                           ##
##      File:     halt.local                                                 ##
##      Author:   Wolfgang S. Rupprecht <wolfgang@xxxxxxxxx>                 ##
##      Created:  Thu Jun  7 23:47:14 PDT 2007                               ##
##      Contents: wsrcc site-specific halt stuff                             ##
##                                                                           ##
##      Copyright (c) 2007 Wolfgang S. Rupprecht.                            ##
##      All rights reserved.                                                 ##
##                                                                           ##
##      $Id$                                                                 ##
###############################################################################
# wsrcc halt script
echo "WSRCC: Clearing /tmp"
cd /
/bin/rm -rf /tmp/* /tmp/.??*
sync; sync; sync;

Or turn /tmp into a tmpfs mount.
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



Relevant Pages

  • Re: Library cache file (CurrentDatabase_360.wmdb) corrupt - CANNOT DEL
    ... Is Media Center or the Sync Center open? ... you can use a tool to mark it for deletion upon reboot. ... I would use another program to sync my MP3 player ...
    (microsoft.public.windowsmedia.player)
  • Re: nfs insecure_locks / Tru64 behaviour
    ... > and server in sync? ... I dunno. ... manner in which the insecure_locks option in /etc/exports is applied to ...
    (Linux-Kernel)
  • Re: thunderbird at ~30% cpu
    ... portables. ... Dunno why, but it stopped. ... Alpine i must say i think is superb. ... After the initial sync (which is obviously required if I want access ...
    (Ubuntu)
  • Re: [opensuse] howto setup a NOT slower than Windows file server?
    ... It may have zero'ed files on power failure, ... dunno if it changed over the time. ... There no reason you can't write a script that calls sync every 5 seconds, ... Then XFS corruption on powerloss is a moot point... ...
    (SuSE)
  • Re: C00D2772
    ... Dunno, you didn't say what you were trying to sync too, so it's a Q&A ... black hole you created. ... Microsoft product support.. ...
    (microsoft.public.windowsmedia)