home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10751 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  2.1 KB

  1. Path: sparky!uunet!mcsun!sunic!dkuug!dde!kw
  2. From: kw@dde.dk (Kurt Wachmann)
  3. Newsgroups: comp.os.linux
  4. Subject: Good way to clean /tmp (was Re: Internal compiler error...)
  5. Message-ID: <1992Sep15.084721.12496@dde.dk>
  6. Date: 15 Sep 92 08:47:21 GMT
  7. References: <1992Sep14.154130.8625@utstat.uucp>
  8. Organization: Dansk Data Elektronik A/S
  9. Lines: 49
  10.  
  11. rafal@utstat.uucp (Rafal Kustra (summer student)) writes:
  12. [ stuff deleted ]
  13. >BTW What is a good way to clean /tmp dir (ie preserving
  14. >crushed editors files, not deleting files being used etc)?
  15. >Thanx
  16. >                Rafal
  17.  
  18. Your Linux (or any *nix) machine should clean /tmp on boot-up after
  19. running expreserve, and whatever things try to read tmp-files after
  20. a crash.
  21.  
  22. If your machine is not booted regularly, you probably need to clean
  23. out /tmp for OLD files; that is files not touched for a few days.
  24.  
  25. This can be done by using cron to run tho following command once a day:
  26.  
  27.     find /tmp -type f -mtime <days> -exec rm {} \;
  28.  
  29. This will not remove untouched directories, so you might want to remove
  30. them AFTER cleaning out old files:
  31.  
  32.     find /tmp -type d -mtime <days> -exec rmdir {} \;
  33.  
  34. This will not harm touched files in a directory with no added or removed
  35. files for some time, however, it will give a warning "directory not empty"
  36. or something like that. Finally, this will remove your /tmp if it's not
  37. mounted and it hasn't been touched for <days>, so you should end your
  38. script with
  39.  
  40.     mkdir /tmp
  41.     chmod 777 /tmp
  42.  
  43. This will normally give you a warning like "unable to make directory" because
  44. it already exists.
  45.  
  46. Normally expreserve (and others like it) are non-destructive to an
  47. active editing session, so you can run these as cronjobs before
  48. cleaning /tmp. But you need to check this in each case.
  49.  
  50.  
  51. /Kurt
  52.  
  53. ---------------------------------------------------------------------------
  54. Kurt Wachmann, M.Sc. EE.     E-mail: kw@dde.dk     First Linux boot: 0.10
  55. -- 
  56.  
  57. +---------------------------------------------------------------------------+
  58. |   Kurt Wachmann @ Dansk Data Elektronik A/S, Herlev, Denmark              |
  59. |   E-mail:  ..!uunet!mcvax!diku!dde!kw  or  kw@dde.dk                      |
  60.