retention fix
This commit is contained in:
@@ -70,8 +70,15 @@ spec:
|
||||
set -euo pipefail
|
||||
echo "Retention sidecar: installing deps..."
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends curl jq python3 >/dev/null
|
||||
apt-get install -y --no-install-recommends curl jq git ca-certificates >/dev/null
|
||||
echo "Retention sidecar: ready"
|
||||
# Sleep until 01:00 so retention runs at night
|
||||
now_epoch=$(date +%s)
|
||||
target_epoch=$(date -d "today 01:00:00" +%s)
|
||||
[ "$target_epoch" -le "$now_epoch" ] && target_epoch=$((target_epoch + 86400))
|
||||
sleep_sec=$((target_epoch - now_epoch))
|
||||
echo "Retention sidecar: next run in $((sleep_sec / 3600))h (at 01:00)"
|
||||
sleep $sleep_sec
|
||||
while true; do
|
||||
/scripts/retention-cleanup.sh
|
||||
echo "Retention sidecar: next run in 24h"
|
||||
|
||||
@@ -33,7 +33,7 @@ spec:
|
||||
- |
|
||||
set -euo pipefail
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends curl jq >/dev/null
|
||||
apt-get install -y --no-install-recommends curl jq git >/dev/null
|
||||
chmod +x /scripts/retention-run.sh /scripts/retention-cleanup.sh
|
||||
/scripts/retention-run.sh
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user