From d4449d445ed8c5c95e267df04d8332231a635aea Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Thu, 21 Mar 2024 05:35:23 +0100 Subject: [PATCH] add teh information --- backup-node.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup-node.sh b/backup-node.sh index 7b13c75f..a41cafdd 100755 --- a/backup-node.sh +++ b/backup-node.sh @@ -13,7 +13,8 @@ for key in $keys; do echo "Executing command with key: /var/lib/docker/volumes/rpc_$key/_data" source_folder="/var/lib/docker/volumes/rpc_$key/_data" - target_file="/backup/rpc_$key-$(date +'%Y-%m-%d-%H-%M-%S').tar.zst" + folder_size=$(du -sh "$source_folder" | awk '{print $1}') + target_file="/backup/rpc_$key-$(date +'%Y-%m-%d-%H-%M-%S')-$folder_size.tar.zst" tar -cf - "$source_folder" | pv -pterb -s $(du -sb "$source_folder" | awk '{print $1}') | zstd -o "$target_file" done