Alt Text

A screenshot of a file manager preview window for my ~/.cache folder, which takes up 164.3 GiB and has 246,049 files and 15,126 folders. The folder was first created about 1.75 years ago with my system

  • Dog@lemmy.world
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    11 months ago

    Question, could you have cron/crontab do it monthly or something? Do it monthly meaning delete everything in ~/.cache every month or so?

      • BaroqueInMind@kbin.social
        link
        fedilink
        arrow-up
        8
        ·
        11 months ago

        This is the good shit I miss from reddit. Thank you for posting a systemd service config, I’m going to implement this.

      • Zangoose@lemmy.worldOP
        link
        fedilink
        English
        arrow-up
        3
        ·
        11 months ago

        Thanks for this! I’ve been meaning to start getting into learning more about systemd and making services, this is super detailed and gives me a pretty good starting point!

    • bizdelnick@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      11 months ago

      Don’t. You don’t need to clean it unless cache of some buggy program grows uncontrollable.

    • cmnybo@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      3
      ·
      11 months ago

      You could have a cronjob run something like find /home/user/.cache -type f -atime +30 -delete, which would find files that haven’t been accessed in the last 30 days and delete them. Make sure your home partition is not mounted with the noatime option though.

    • Zangoose@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      11 months ago

      I just found this today, I don’t really know anything about cron jobs but this will probably incentive me to learn lol

      • SuperIce@lemmy.world
        link
        fedilink
        English
        arrow-up
        9
        ·
        11 months ago

        Did you happen to see which subdirectory was using up this much space? I don’t think I’ve ever seen .cache go above 10GB, so this may be a bug in a piece of software you use.

          • Zangoose@lemmy.worldOP
            link
            fedilink
            English
            arrow-up
            4
            ·
            edit-2
            11 months ago

            Looks like yay is storing every previous binary for AUR bin packages (also excuse the unreadable terminal theme, it doesn’t play very well with a lot of TUI apps unless they support custom theming)

            • neonred@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              11 months ago

              Wow, I’ve never seen something like this.

              Is it" allowed"? I mean, there are quotas for user homes.