799
you are viewing a single comment's thread
view the rest of the comments

My favorite thing is purging remote cached media.

You need a timestamp, which is fine.

You just need to figure out how many miliseconds since the unix epoch the media you want to purge was uploaded, and then offset the time to only purge that old or older.

Easy!

[-] marcos@lemmy.world 3 points 2 years ago

So, you need a unix time value followed by 000?

That first part you can calculate with date +%s -d '2024-07-02 12:00'.

I ended up doing basically that.

Current time in ms, minus 2629800000 (a month) = timestamp to use to prune from.

this post was submitted on 02 Aug 2024
799 points (96.6% liked)

Selfhosted

59939 readers
676 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam.

  3. Posts here are to be centered around self-hosting. Please ensure it is clear in your post how it relates to self-hosting.

  4. Don't duplicate the full text of your blog or git here. Just post the link for folks to click.

  5. Submission headline should match the article title.

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS