psql conf

This commit is contained in:
oliver
2026-08-14 19:28:37 -03:00
parent dcaaf46ef3
commit 3acdc81891
3 changed files with 16 additions and 5 deletions
+2 -4
View File
@@ -5,10 +5,8 @@
RETENTION_DAYS=28
wait_for_midnight() {
NOW=$(date +%s)
MIDNIGHT=$(date -d 'tomorrow 00:00' +%s 2>/dev/null || \
date -d "$(date -d tomorrow '+%Y-%m-%d') 00:00:00" +%s)
SLEEP=$(( MIDNIGHT - NOW ))
ELAPSED=$(( $(date +%H) * 3600 + $(date +%M) * 60 + $(date +%S) ))
SLEEP=$(( 86400 - ELAPSED ))
echo "Waiting ${SLEEP}s until midnight..."
sleep "$SLEEP"
}