home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!dkuug!dde!kw
- From: kw@dde.dk (Kurt Wachmann)
- Newsgroups: comp.os.linux
- Subject: Good way to clean /tmp (was Re: Internal compiler error...)
- Message-ID: <1992Sep15.084721.12496@dde.dk>
- Date: 15 Sep 92 08:47:21 GMT
- References: <1992Sep14.154130.8625@utstat.uucp>
- Organization: Dansk Data Elektronik A/S
- Lines: 49
-
- rafal@utstat.uucp (Rafal Kustra (summer student)) writes:
- [ stuff deleted ]
- >BTW What is a good way to clean /tmp dir (ie preserving
- >crushed editors files, not deleting files being used etc)?
- >Thanx
- > Rafal
-
- Your Linux (or any *nix) machine should clean /tmp on boot-up after
- running expreserve, and whatever things try to read tmp-files after
- a crash.
-
- If your machine is not booted regularly, you probably need to clean
- out /tmp for OLD files; that is files not touched for a few days.
-
- This can be done by using cron to run tho following command once a day:
-
- find /tmp -type f -mtime <days> -exec rm {} \;
-
- This will not remove untouched directories, so you might want to remove
- them AFTER cleaning out old files:
-
- find /tmp -type d -mtime <days> -exec rmdir {} \;
-
- This will not harm touched files in a directory with no added or removed
- files for some time, however, it will give a warning "directory not empty"
- or something like that. Finally, this will remove your /tmp if it's not
- mounted and it hasn't been touched for <days>, so you should end your
- script with
-
- mkdir /tmp
- chmod 777 /tmp
-
- This will normally give you a warning like "unable to make directory" because
- it already exists.
-
- Normally expreserve (and others like it) are non-destructive to an
- active editing session, so you can run these as cronjobs before
- cleaning /tmp. But you need to check this in each case.
-
-
- /Kurt
-
- ---------------------------------------------------------------------------
- Kurt Wachmann, M.Sc. EE. E-mail: kw@dde.dk First Linux boot: 0.10
- --
-
- +---------------------------------------------------------------------------+
- | Kurt Wachmann @ Dansk Data Elektronik A/S, Herlev, Denmark |
- | E-mail: ..!uunet!mcvax!diku!dde!kw or kw@dde.dk |
-