From af954eda2ac756a88bdcc54e913c4f0d675e4eba Mon Sep 17 00:00:00 2001 From: skylar Date: Wed, 31 May 2023 17:48:59 -0500 Subject: [PATCH] corn job --- database-cleanup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 database-cleanup.sh diff --git a/database-cleanup.sh b/database-cleanup.sh new file mode 100644 index 0000000..aa22d77 --- /dev/null +++ b/database-cleanup.sh @@ -0,0 +1,8 @@ +#!/bin/bash +cd /opt/pleroma +systemctl stop pleroma +sudo -Hu pleroma MIX_ENV=prod mix pleroma.database prune_objects +sudo -Hu pleroma MIX_ENV=prod mix pleroma.database vacuum full +sudo -Hu postgres vacuumdb --all --analyze-in-stages +systemctl start pleroma +sudo -Hu postgres pg_repack -a -j 3