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

Selfhosted

60366 readers
1123 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:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details.

Resources:

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

Questions? DM the mods!

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] schizo@forum.uncomfortable.business 1 points 2 years ago (1 children)

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 (1 children)

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.