Results 1 to 6 of 6

Thread: Folder /tmp: what can be deleted?

  1. #1
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Folder /tmp: what can be deleted?

    I notice a growing number of folders in this directory (/tmp) that are empty. What restrictions or guidelines are there on deletion of any of the contents of this folder?
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  2. #2
    Join Date
    Jan 2008
    Location
    U.K East Anglia
    Posts
    2,581

    Default Re: Folder /tmp: what can be deleted?

    you can delete anything in there that's not being used by a current running program.most of it should be automatically cleared out anyway,by a cron job run by the system daily

    Andy
    To be is to do = Immanuel Kant
    To do is to be = Descartes.
    Do be do be do = Frank Sinatra

    SuSE user since 7.0,Linux user since 1994

  3. #3
    ab@novell.com NNTP User

    Default Re: Folder /tmp: what can be deleted?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    /tmp is just as described.... temporary stuff. Worst-case scenario
    there are settings in Yast (as I recall) that will delete all the
    contents of /tmp on a reboot. Deleting everything in there at other
    times could be a problem. I periodically, on my desktop which never
    restarts, go in and delete stuff that's over a month old. If you want
    to reboot use a Knoppix disk, or just come up in runlevel 1 temporarily,
    and nuke everything in there, then finish booting to runlevel 3/5/whatever.

    Good luck.





    XEyedBear wrote:
    > I notice a growing number of folders in this directory (/tmp) that are
    > empty. What restrictions or guidelines are there on deletion of any of
    > the contents of this folder?
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIr9hv3s42bA80+9kRAqWiAJ9FDWpzR5P6QaROGv2C8fhIO+vx1ACfTjQH
    8WAzsi7HolGcY6qTMg3xMVs=
    =EUCK
    -----END PGP SIGNATURE-----

  4. #4
    Join Date
    Jun 2008
    Location
    UK; deep south, far below Watford.
    Posts
    275

    Default Re: Folder /tmp: what can be deleted?

    Quote Originally Posted by deltaflyer44 View Post
    ...most of it should be automatically cleared out anyway,by a cron job run by the system daily

    Andy
    This doesn't seem to happen on my system - there are a number of folders in there dating back to the time of my first installation of OpenSuSE in June. How do I check if the daily 'cron job' (?) is actually being run?
    They said I wasn't fit to live with a pig; my brother stood up for me and said I was.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,110
    Blog Entries
    15

    Default Re: Folder /tmp: what can be deleted?

    Quote Originally Posted by XEyedBear
    deltaflyer44;1860995 Wrote:
    > ...most of it should be automatically cleared out anyway,by a cron job
    > run by the system daily
    >
    > Andy


    This doesn't seem to happen on my system - there are a number of
    folders in there dating back to the time of my first installation of
    OpenSuSE in June. How do I check if the daily 'cron job' (?) is actually
    being run?
    Hi
    I'm sure cron would be running, but it's dependant on whether you have
    set the days either via YaST etc/sysconfig/editor (search on
    MAX_DAYS_IN_TMP) or manually editing /etc/sysconfig/cron to enable
    it (by default its disabled)

    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.0 x86 Kernel 2.6.25.11-0.1-default
    up 1 day 6:34, 3 users, load average: 0.28, 0.07, 0.09
    GPU GeForce 6600 TE/6200 TE - Driver Version: 173.14.12


  6. #6
    Join Date
    Jun 2008
    Location
    Oklahoma, US
    Posts
    822

    Default Re: Folder /tmp: what can be deleted?

    On Sun, 24 Aug 2008 22:37:55 GMT
    Malcolm <malcolm_nospamlewis@bellsouth.net> wrote:

    >
    Quote Originally Posted by XEyedBear
    > deltaflyer44;1860995 Wrote:
    > > ...most of it should be automatically cleared out anyway,by a cron job
    > > run by the system daily
    > >
    > > Andy

    >
    > This doesn't seem to happen on my system - there are a number of
    > folders in there dating back to the time of my first installation of
    > OpenSuSE in June. How do I check if the daily 'cron job' (?) is actually
    > being run?
    >
    > Hi
    > I'm sure cron would be running, but it's dependant on whether you have
    > set the days either via YaST etc/sysconfig/editor (search on
    > MAX_DAYS_IN_TMP) or manually editing /etc/sysconfig/cron to enable
    > it (by default its disabled)
    >


    As root, edit the file:

    /etc/sysconfig/cron

    Change some default values:

    MAX_DAYS_IN_TMP="3"

    MAX_DAYS_IN_LONG_TMP="3"

    TMP_DIRS_TO_CLEAR="/tmp"

    LONG_TMP_DIRS_TO_CLEAR="/var/tmp"

    CLEAR_TMP_DIRS_AT_BOOTUP="yes"

    DAILY_TIME="04:15"

    MAX_NOT_RUN="3"

    Save the file. If you don't do anything, the cron daemon will begin pruning
    the older entries in /tmp, BUT it won't delete anything owned by root, so
    things build up.

    The settings you changed above (read the comments in the file) cause the
    system to wipe clean the /tmp and /var/tmp subdirectories on every boot.
    Even root's stuff.

    This also prevents any nasty programs hiding anything in /tmp or /var/tmp for
    use later.

    Loni

    --
    L R Nix
    lornix@lornix.com


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •