Lemmy self-hosters. What is your image cleanup process?

I’m self-hosting the docker containers and I noticed the pictrs directory is steadily growing because of the cached images. Does anyone know if it gets cleaned up automatically or are hosters running scripts to clean it up after a certain amount of time? The install guides make no mention of it from what I can find.

poVoq,
@poVoq@slrpnk.net avatar

Remote images are not cached or proxied right now as far as I know. Edit: seems I was wrong and there is some image caching happening. For sure for the small image thumbnails, but also sometimes for other pictures, but it seems very inconsistent.

Your growning pictrs directory might be also due to the extremely verbose default logging that Pictrs (and the Lemmy backend too btw) uses.

a253040,

IIRC, I’ve read comments elsewhere that pictrs caches for 6 months, but I can’t independently verify. I hope this gets a broader answer because I’m still on the fence about getting an instance set up for myself and some small communities.

rs5th,
@rs5th@lemmy.scottlabs.io avatar

I believe the activity table in Postgres is retained for 6 months (although I’m purging mine daily) and the pict-rs cache is 168 hours (1 week).

a253040,

I knew I read something was kept for 6 months ;)

Glad to see that even here, the best way to get the right answer on the internet is to provide a wrong one.

Quindius,

How do you purge daily? Also, does that delete any post history or anything in a similar vein?

rs5th,
@rs5th@lemmy.scottlabs.io avatar

I’m running the following SQL, although I’m not actually sure it’s as necessary since 0.18.3. It doesn’t delete any post history or anything.


<span style="font-weight:bold;color:#a71d5d;">DELETE FROM</span><span style="color:#323232;"> activity </span><span style="font-weight:bold;color:#a71d5d;">WHERE</span><span style="color:#323232;"> published &lt; NOW() </span><span style="font-weight:bold;color:#a71d5d;">-</span><span style="color:#323232;"> INTERVAL </span><span style="color:#183691;">'1 day'</span><span style="color:#323232;">;
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines