15 lines
245 B
Bash
15 lines
245 B
Bash
|
#!/usr/bin/env sh
|
||
|
|
||
|
TO_DELETE=$( b2v4 ls b2://"$BUCKET_NAME" | tac | tail -n +8 | tr '\n' ' ' )
|
||
|
|
||
|
PIDS=""
|
||
|
for file in $TO_DELETE; do
|
||
|
b2v4 rm "b2://${BUCKET_NAME}/${file}" &
|
||
|
PIDS="$PIDS $!"
|
||
|
done
|
||
|
|
||
|
for pid in $PIDS; do
|
||
|
wait "${pid}"
|
||
|
done
|
||
|
|