Results 1 to 7 of 7

Thread: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

  1. #1
    Join Date
    Sep 2008
    Beans
    540
    Distro
    Kubuntu 12.04 Precise Pangolin

    Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    sudo find /tmp -mtime +1 -exec rm -f {} \;

    And second, why can't I see the "New Thread" orange button in the "Development and Programming" subforum? Is it limited now?
    Registered Linux User #479009
    Friend-->Linux; 6 and counting...

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    Why would you want to delete anything in /tmp ?

    /tmp gets deleted every time you boot your machine.
    Cheesemill

  3. #3
    Join Date
    Sep 2008
    Beans
    540
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    tmp is filling rapidly, and I don't reboot my machine but about once a week. I have a 10GB home partition, and tmp gets up to 3GB pretty quickly given my activity; I have started having issues with no space on /home. So, I want to run a cleaner script, and this is one of the lines.

    And I still don't know why I can't post this in Development and Programming; anyone know?
    Registered Linux User #479009
    Friend-->Linux; 6 and counting...

  4. #4
    PaulW2U is offline I Ubuntu, Therefore, I Am
    Join Date
    May 2010
    Beans
    3,110
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    Quote Originally Posted by tarahmarie View Post
    And I still don't know why I can't post this in Development and Programming; anyone know?
    Because that forum is Read Only?

    You should be able to post in most of the Development and Programming sub-forums though.

  5. #5
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    Quote Originally Posted by tarahmarie View Post
    And I still don't know why I can't post this in Development and Programming; anyone know?
    Development and Programming is a top-level category, you have to click on one of the sub-forums to choose which one to post into.
    Cheesemill

  6. #6
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    is there an error message? if there are A LOT of files, you may be overflowing the argument list - in which case try xargs

    http://ubuntuforums.org/showpost.php...35&postcount=4

  7. #7
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Why doesn't this bash line delete all /tmp/ files over 24 hours old?

    Quote Originally Posted by tarahmarie View Post
    sudo find /tmp -mtime +1 -exec rm -f {} \;

    And second, why can't I see the "New Thread" orange button in the "Development and Programming" subforum? Is it limited now?
    I agree with the others, you should find the source of the problem. i believe the reason why this is not working probably because the exec rm is not being executed with elevated permissions. You could try this rather scary incantation
    Code:
    sudo find /tmp -mtime +1 -exec sudo rm -f {} \;
    -BAB1

Bookmarks

Posting Permissions

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