Files
M-CTF-2025/neuralink/build/cleaner/cleaner.sh
2025-12-14 11:22:42 +03:00

7 lines
357 B
Bash

#!/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