1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-28 10:07:12 -07:00

skip files larger than 512 MiB

This commit is contained in:
Connor Olding 2021-09-16 13:08:06 -07:00
parent ddec5dc5a3
commit d6ca35b4d1

6
sh/oxo
View File

@ -63,6 +63,12 @@ oxo() { ### @-
else
local kib="$(du -k "$f" | cut -f1)"
if [ "$kib" -gt 524288 ]; then
: $((fails+=1))
printf "$bad" "oxo: file too large: $f" >&2
continue
fi
# compute retention using (fixed point) integers only.
# retention = (365 - 30) * ([file size] / [512 MiB] - 1)**3 + 30
local a=$(( kib/16+1 ))