From 3e76fc49b06ef126bf54c8c0401142cb28a16704 Mon Sep 17 00:00:00 2001 From: sometimesuseful <> Date: Wed, 13 Nov 2024 15:48:36 +0000 Subject: [PATCH] added logging for when the input file is smaller than volume size --- modules/create_archive | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/create_archive b/modules/create_archive index cc9dbed..1a2c8e0 100755 --- a/modules/create_archive +++ b/modules/create_archive @@ -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 ))