diff --git a/b2-retention.sh b/b2-retention.sh index 0ba056b..85f346a 100755 --- a/b2-retention.sh +++ b/b2-retention.sh @@ -1,6 +1,8 @@ #!/usr/bin/env sh -TO_DELETE=$( b2v4 ls b2://"$BUCKET_NAME" | tac | tail -n +8 | tr '\n' ' ' ) +FILE_QUOTA=${FILE_QUOTA:-7} +FILE_QUOTA=$(("$FILE_QUOTA" + 1)) +TO_DELETE=$( b2v4 ls b2://"$BUCKET_NAME" | tac | tail -n +"$FILE_QUOTA" | tr '\n' ' ' ) PIDS="" for file in $TO_DELETE; do