added logging for when the input file is smaller than volume size
This commit is contained in:
parent
665e356842
commit
3e76fc49b0
1 changed files with 4 additions and 1 deletions
|
|
@ -32,7 +32,10 @@ calc_smart_volumes() {
|
|||
total_size=$(du -s -BM "${input_file}" | grep -oP '^\d+') || return 1
|
||||
|
||||
# If total file size is smaller than volume size, don't pack it into volumes
|
||||
(( total_size < size )) && return 1
|
||||
if (( total_size < size)); then
|
||||
log "WARN" "$input_file is smaller than ${size}MB, skipping volumes"
|
||||
return 1
|
||||
fi
|
||||
|
||||
num_volumes=$(( (total_size + size - 1) / size ))
|
||||
smart_size=$(( (total_size + num_volumes - 1) / num_volumes ))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue