From ab51c2db7c048a4d5709f4eca95a9a88f8055f20 Mon Sep 17 00:00:00 2001 From: Pierre Prinetti Date: Thu, 7 Sep 2023 14:47:08 +0200 Subject: [PATCH] Set timeout for cleanup at 7h Also rename the flag `--delete-everything-older-than-5-hours` to `--no-dry-run` --- clean-ci-resources.sh | 4 ++-- list-clusters.sh | 2 +- stale.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clean-ci-resources.sh b/clean-ci-resources.sh index 930b1ba..912dc49 100755 --- a/clean-ci-resources.sh +++ b/clean-ci-resources.sh @@ -9,7 +9,7 @@ fi for arg in "$@"; do shift case "$arg" in - "--delete-everything-older-than-5-hours") set -- "$@" "-f" ;; + "--no-dry-run") set -- "$@" "-f" ;; *) set -- "$@" "$arg" esac done @@ -27,7 +27,7 @@ while getopts :o:f opt; do done if [ $DELETE != 1 ]; then - echo "Refusing to run unless passing the --delete-everything-older-than-5-hours option" + echo "Refusing to run unless passing the --no-dry-run option" exit 5 fi diff --git a/list-clusters.sh b/list-clusters.sh index e83abb5..9d42ac4 100755 --- a/list-clusters.sh +++ b/list-clusters.sh @@ -34,7 +34,7 @@ print_cluster_id() { esac } -VALID_LIMIT="$(date --date='-5 hours' +%s)" +VALID_LIMIT="$(date --date='-7 hours' +%s)" readonly VALID_LIMIT declare filter='' diff --git a/stale.sh b/stale.sh index 02e2f21..dbf0c09 100755 --- a/stale.sh +++ b/stale.sh @@ -61,7 +61,7 @@ fi declare -r resource_type="$*" declare valid_limit -valid_limit="$(date --date='-5 hours' +%s)" +valid_limit="$(date --date='-7 hours' +%s)" readonly valid_limit list_server() {