make file retention count variable

This commit is contained in:
Rowan 2024-12-28 00:49:37 -06:00
parent ad38c09210
commit 891dc82a1b

View file

@ -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