Find the answer to your Linux question:
Results 1 to 6 of 6
Hello Guys, Just a quick query really, I notice that when the box is reset it clears the /tmp directory, is there a way of adding another directory so that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    49

    Clearing the /tmp Directory


    Hello Guys,

    Just a quick query really, I notice that when the box is reset it clears the /tmp directory, is there a way of adding another directory so that it gets cleared when the box is shutdown or reboots?

    Thanks,

    Rob

  2. #2
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi SirRawlins,
    You can add the line to remove the contents of the directory you want, in the S01reboot file in /etc/rc.d/rc6.d

    Just take care not to remove any other line in the file. Backup the original copy, before you start editing rc6.d, if you wish to be on a safer side.

    With Regards,
    Thinker

  3. #3
    Linux Enthusiast
    Join Date
    Jun 2005
    Posts
    668
    I'm not sure /tmp gets cleared on boot automatically in the initscripts. I remember having to add it myself

    What thinker replied with wont work, there is no such file

    "You can add the line to remove the contents of the directory you want, in the S01reboot file in /etc/rc.d/rc6.d"

    looks like he's getting the systemV layout confused with slackwares BSD init layout

    if you want it to clear the 'other' directory on boot you could add something similar to this, in /etc/rc.d/rc.local

    Code:
    echo "Emptying /tmp"
    rm /tmp/* -rf &1>2 > /dev/null
    echo "Emptying /tmp/blech"
    rm /tmp/blech/* -rf &1>2 > /dev/null
    thats similar to what I have on my system to clear /tmp, the /dev/null part simply throws away the output or any error codes.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User
    Join Date
    Jun 2006
    Posts
    311
    Hi kern and SirRawlins,
    Sorry about that. I did not realize at the time of posting that SirRawlins was refering to a Slackware. I should have checked on which forum it was posted.

    Thanks kern, for pointing out the mistake.

    With Regards,
    Thinker

  6. #5
    Just Joined!
    Join Date
    Jun 2006
    Posts
    49
    The Thinker: Thanks for your effort buddy.

    Kern: Awsome, as always, tell the boss i reccomend you for promotion and a big fat payrise.

    Rob

  7. #6
    Linux Enthusiast
    Join Date
    Jun 2005
    Posts
    668
    Quote Originally Posted by SirRawlins
    The Thinker: Thanks for your effort buddy.

    Kern: Awsome, as always, tell the boss i reccomend you for promotion and a big fat payrise.

    Rob
    heh, I only started 3 months ago at my job, doubt a payrise is any time soon.


Posting Permissions

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