Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Mastodon media cache cleanup is doing nothing?

    Mastodon
    3
    5
    1558
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      whitespace last edited by

      I am running Mastodon on my Cloudron.
      Since the media cache tends to use up much space quickly I looked up a way to delete it from time to time.

      Fortunately there is already a cleanup script available in the mastodon terminal.

      /app/pkg/cleanup.sh
      

      Thanks for that.


      I tried the script as well as the pure command which is

      ./bin/tootctl media remove
      

      The outcome is this:

      Removed 0 media attachments (approx. 0 Bytes)
      

      I restarted the application, rechecked. The disk usage remained the same.

      Using the following command I checked, how things look from the tooctl´s perspective in contrast to the Cloudron volumes inspector.

      .bin/tooctl media usage
      

      Result:

      
      Attachments:    3.01 GB (3.54 MB local)
      Custom emoji:   4.98 MB (0 Bytes local)
      Preview cards:  63 MB
      Avatars:        101 MB (116 KB local)
      Headers:        297 MB (195 KB local)
      Backups:        0 Bytes
      Imports:        0 Bytes
      Settings:       204 KB
      

      As you can see the Attachments take up 3.01 GB and I can´t delete them. What is the problem? I do not understand. I suppose it is something specific to the Cloudron installation?

      doodlemania2 jdaviescoates 2 Replies Last reply Reply Quote 0
      • W
        whitespace last edited by whitespace

        Solution:

        ./bin/tootctl media remove
        

        has an option

        --days
        

        which defaults to 7 days of not set.

        Our instance is only 3 days old. Since i did not set the flag it defaulted to 7 days.
        The system did everything right. There were no files as old or older than 7 days. Accordingly it did not delete anything. Computer smart.

        I was able to delete the cached media files.

        1 Reply Last reply Reply Quote 1
        • doodlemania2
          doodlemania2 App Dev @whitespace last edited by

          @whitespace Is there a default aging limit to what it will remove?

          1 Reply Last reply Reply Quote 0
          • jdaviescoates
            jdaviescoates @whitespace last edited by

            @whitespace said in Mastodon media cache cleanup is doing nothing?:

            3.01 GB (3.54 MB local)

            I know nothing about this, but perhaps the issue is that only 3.54 MB are local?

            Just a random guess, but I'd guess perhaps you're not actually able to delete attachments posted by non-local accounts? 🤷

            I use Cloudron with Gandi & Hetzner

            W 1 Reply Last reply Reply Quote 0
            • W
              whitespace @jdaviescoates last edited by

              @jdaviescoates I had this thought. I consulted other Mastodon admins. They say, they can delete everything. This should not occur.

              1 Reply Last reply Reply Quote 1
              • W
                whitespace last edited by whitespace

                Solution:

                ./bin/tootctl media remove
                

                has an option

                --days
                

                which defaults to 7 days of not set.

                Our instance is only 3 days old. Since i did not set the flag it defaulted to 7 days.
                The system did everything right. There were no files as old or older than 7 days. Accordingly it did not delete anything. Computer smart.

                I was able to delete the cached media files.

                1 Reply Last reply Reply Quote 1
                • Topic has been marked as a question  girish girish 
                • Topic has been marked as solved  girish girish 
                • First post
                  Last post
                Powered by NodeBB