#!/usr/bin/env bash while true; do psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db:5432/$POSTGRES_DB -c "DELETE FROM users WHERE timestamp <= NOW() - INTERVAL '15 minutes'"; psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db:5432/$POSTGRES_DB -c "DELETE FROM implants WHERE timestamp <= NOW() - INTERVAL '15 minutes'"; sleep 60; done