Flax@feddit.uk to Selfhosted@lemmy.worldEnglish · 2 years agoWhat self hosting feels like (It's painful, please help 🥲)feddit.ukimagemessage-square193linkfedilinkarrow-up1826arrow-down129
arrow-up1797arrow-down1imageWhat self hosting feels like (It's painful, please help 🥲)feddit.ukFlax@feddit.uk to Selfhosted@lemmy.worldEnglish · 2 years agomessage-square193linkfedilink
minus-squareschizo@forum.uncomfortable.businesslinkfedilinkEnglisharrow-up1·2 years agoMy 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!
minus-squaremarcos@lemmy.worldlinkfedilinkEnglisharrow-up3·2 years agoSo, you need a unix time value followed by 000? That first part you can calculate with date +%s -d '2024-07-02 12:00'.
minus-squareschizo@forum.uncomfortable.businesslinkfedilinkEnglisharrow-up2·2 years agoI ended up doing basically that. Current time in ms, minus 2629800000 (a month) = timestamp to use to prune from.
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!
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.