Allow to set cache retention days

This commit is contained in:
Johannes Zellner
2023-04-26 13:04:46 +02:00
parent 4b80104980
commit cef9a1bdbd
3 changed files with 21 additions and 4 deletions

View File

@@ -5,11 +5,24 @@ set -eu
echo "=> Cleanup"
cd /app/code
if [[ ! -f /app/data/cache-env.sh ]]; then
echo "==> Createing initial cache-env.sh"
cp /app/pkg/cache-env.sh.template /app/data/cache-env.sh
fi
source /app/data/cache-env.sh
echo "==> media cache ..."
./bin/tootctl media remove --days=1
./bin/tootctl media remove --days=${CACHE_RETENTION_DAYS}
echo "==> orphaned media ..."
./bin/tootctl media remove-orphans
echo "==> preview cards.."
./bin/tootctl preview-cards remove --days=1
echo "==> preview cards ..."
./bin/tootctl preview-cards remove --days=${CACHE_RETENTION_DAYS}
echo "==> prune profiles ..."
./bin/tootctl media remove --prune-profiles --days=${CACHE_RETENTION_DAYS}
echo "==> remove headers ..."
./bin/tootctl media remove --remove-headers --days=${CACHE_RETENTION_DAYS}