From 7515716e7f3950a3a6de04aac1b88215aa40795e Mon Sep 17 00:00:00 2001 From: Starfall Date: Tue, 17 Jan 2023 13:59:40 -0600 Subject: update almost everything except the setup script --- maintenance | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 maintenance (limited to 'maintenance') diff --git a/maintenance b/maintenance new file mode 100644 index 0000000..f214eff --- /dev/null +++ b/maintenance @@ -0,0 +1,29 @@ +######## +# clean up docker images +/usr/bin/docker system prune -f 2>&1 >/dev/null + +# clear out old remote statuses that have never been touched (favorited, followed, etc) +# the "Content cache retention period" setting is significantly more aggressive since it removes *all* old remote posts +sudo docker-compose exec mastodon-web tootctl statuses remove --days 90 + +######## +# these are useful maintenance tasks but already covered by other settings +# just turn autovacuum on +sudo docker-compose exec -u 70 db psql -c 'VACUUM ANALYZE;' + +# covered by the new "Media cache retention period" setting +sudo docker-compose exec mastodon-web tootctl media remove --days 30 +sudo docker-compose exec mastodon-web tootctl preview_cards remove --days 30 + +######### +# run these only with careful consideration, they're slow and may require taking the instance down for maintenance +# clear out nonextant remote accounts (this will nuke monsterpit and pv... :c ) +sudo docker-compose exec mastodon-web tootctl accounts cull + +# remove loose media files, quite slow but should save una a little bit of costs +sudo docker-compose exec mastodon-web tootctl media remove-orphans + +# postgres vacuum full, requires instance down +# first line requies pgstattuple module +SELECT * FROM pgstattuple('table'); -- see if free_percent is high +VACUUM FULL table; -- cgit