pleromer-stuff/database-cleanup.sh
2023-05-31 17:48:59 -05:00

9 lines
292 B
Bash

#!/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