mirror of
https://github.com/notwa/rc
synced 2024-11-05 00:39:02 -08:00
skip files larger than 512 MiB
This commit is contained in:
parent
ddec5dc5a3
commit
d6ca35b4d1
1 changed files with 6 additions and 0 deletions
6
sh/oxo
6
sh/oxo
|
@ -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 ))
|
||||
|
|
Loading…
Reference in a new issue