diff --git a/backup-node.sh b/backup-node.sh index 6aa1f867..33c5128c 100755 --- a/backup-node.sh +++ b/backup-node.sh @@ -26,10 +26,12 @@ for key in $keys; do } else if ($1 ~ /[Tt]$/) { size *= 1000 # convert terabytes to gigabytes } - print size "G" + print size }') + + folder_size_gb=$(printf "%.0f" "$folder_size") - target_file="/backup/rpc_$key-$(date +'%Y-%m-%d-%H-%M-%S')-$folder_size.tar.zst" + target_file="/backup/rpc_$key-$(date +'%Y-%m-%d-%H-%M-%S')-${folder_size_gb}G.tar.zst" #echo "$target_file" tar -cf - "$source_folder" | pv -pterb -s $(du -sb "$source_folder" | awk '{print $1}') | zstd -o "$target_file"