mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat: fix cleanup further
This commit is contained in:
parent
17f0626207
commit
28ee21b60b
1 changed files with 5 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ MONTHS_TO_KEEP=1
|
||||||
# Helper functions
|
# Helper functions
|
||||||
send_discord_message() {
|
send_discord_message() {
|
||||||
local message="$1"
|
local message="$1"
|
||||||
|
echo "$message"
|
||||||
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
local escaped_message=$(printf '%s' "$message" | jq -R -s '.')
|
||||||
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
curl -s -H "Accept: application/json" -H "Content-Type: application/json" \
|
||||||
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
-X POST --data "{\"content\": $escaped_message}" "$DISCORD_WEBHOOK_LINK"
|
||||||
|
|
@ -89,8 +90,11 @@ main() {
|
||||||
|
|
||||||
send_discord_message "Performing database optimization"
|
send_discord_message "Performing database optimization"
|
||||||
systemctl stop matrix-synapse
|
systemctl stop matrix-synapse
|
||||||
|
export PGHOST=/var/run/postgresql/
|
||||||
|
export PGDATABASE=matrix-synapse
|
||||||
|
export PGUSER=matrix-synapse
|
||||||
|
|
||||||
sudo -u postgres psql <<_EOF
|
sudo -u postgres psql matrix-synapse <<_EOF
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
DELETE
|
DELETE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue