psql conf
This commit is contained in:
+2
-4
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user