pleromer-stuff/database-cleanup.sh

9 lines
292 B
Bash
Raw Permalink Normal View History

2023-05-31 22:48:59 +00:00
#!/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