Conversation
Notices
-
Embed this notice
Vivi Nella Verita (verita84eva@poster.place)'s status on Saturday, 27-Apr-2024 01:59:09 JST Vivi Nella Verita @dj
A function to actually clean Akkoma /Pleroma well
```
DATABASES=(akkoma detroitriotcity)
echo "Stopping Akkoma"
systemctl stop akkoma
for i in "${DATABASES[@]}"; do
echo "Scanning Fderated Posts to Delete: $i"
su postgres -s /bin/bash -lc "echo \"SELECT COUNT(*) FROM \"objects\" AS o0 WHERE (o0.\"data\"->'to' ? 'https://www.w3.org/ns/activitystreams#Public' OR o0.\"data\"->'cc' ? 'https://www.w3.org/ns/activitystreams#Public') AND (o0.\"inserted_at\" < now() - interval '15 days' ) AND (split_part(o0.\"data\"->>'actor', '/', 3) != '$i')\" | psql $i"
echo "Deleting Objects for: $i"
su postgres -s /bin/bash -lc "echo \"DELETE FROM \"objects\" AS o0 WHERE (o0.\"data\"->'to' ? 'https://www.w3.org/ns/activitystreams#Public' OR o0.\"data\"->'cc' ? 'https://www.w3.org/ns/activitystreams#Public') AND (o0.\"inserted_at\" < now() - interval '15 days' ) AND (split_part(o0.\"data\"->>'actor', '/', 3) != '$i')\" | psql $i"
echo "Deleting Activities for: $i"
su postgres -s /bin/bash -lc "echo \"DELETE FROM \"activities\" where data->>'type' = 'Create' and local = 'f' and inserted_at < now() - interval '10 days'"\" | psql $i
echo "Starting Akkoma: $i"
systemctl start akkoma
done
}
```-
Embed this notice
DJ :debian: :coolcat: :colombia: (dj@parcero.bond)'s status on Saturday, 27-Apr-2024 01:59:08 JST DJ :debian: :coolcat: :colombia: @verita84eva
This high quality scripting, nice.
Mint mentioned setting session_replication_role = replica before and back to default after. I read up on this and this is a good idea. This link might interest you. TLDR it stops triggering actions, less errors.
https://www.endpointdev.com/blog/2015/07/selectively-firing-postgres-triggers/
Also, why is there a url to w3, does script need internet? Guess I didn't understand that part. :pleromatanshrug:
But this is awesome and I'm copying it. :terry_half:✙ dcc :pedomustdie: :phear_slackware: likes this. -
Embed this notice
Vivi Nella Verita (verita84eva@poster.place)'s status on Saturday, 27-Apr-2024 01:59:16 JST Vivi Nella Verita @dj
https://pastebin.com/AHQeTtCpIn conversation permalink Attachments
-
Embed this notice
DJ :debian: :coolcat: :colombia: (dj@parcero.bond)'s status on Saturday, 27-Apr-2024 01:59:16 JST DJ :debian: :coolcat: :colombia: @verita84eva
I'll try it out soon. My db grew 1 gb in just two weeks. That's lot of junk in the trunk for one user.In conversation permalink Attachments
✙ dcc :pedomustdie: :phear_slackware: likes this. -
Embed this notice
✙ dcc :pedomustdie: :phear_slackware: (dcc@annihilation.social)'s status on Saturday, 27-Apr-2024 01:59:38 JST ✙ dcc :pedomustdie: :phear_slackware: @dj @verita84eva That would be your image folder getting bigger
F2kREqjWIAAJE19.pngIn conversation permalink Attachments
-
Embed this notice
DJ :debian: :coolcat: :colombia: (dj@parcero.bond)'s status on Saturday, 27-Apr-2024 01:59:39 JST DJ :debian: :coolcat: :colombia: @verita84eva
It's probably because every post I attach an image thats close to 1 mb.In conversation permalink
-
Embed this notice