media_purge.sh
changeset 1 ba8922061637
parent 0 4216bf35912e
child 2 c3f49b58aff6
--- a/media_purge.sh	Wed Mar 24 10:16:42 2021 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-# purge (foreign) media cache
-# (cc) Peter 'grin' Gervai, 2020
-
-# import $T access token (macaroon)
-. /root/matrix-synapse/clean_auto/_config.sh
-
-U="https://matrix.grin.hu:8448/"
-TM=`date +%s`
-
-# T - 1week
-###TM=$(( TM - 60*60*24*7 ))
-
-# T - 1 hour
-TM=$(( TM - 60*60 ))
-
-printf "Purging up to %s\n", "`date --date="@${TM}"`"
-TM="${TM}000"
-STAMP=$TM
-
-MODE="POST"
-#CMD="_matrix/client/r0/admin/purge_media_cache?before_ts=$STAMP"
-CMD="_synapse/admin/v1/purge_media_cache?before_ts=$STAMP"
-
-time curl -s -d '{}' -X${MODE} "${U}${CMD}&access_token=$T" | jq