From 73736e3004b907494f61c07d9a0a73f4f9e0eb56 Mon Sep 17 00:00:00 2001 From: Marco Cetica Date: Wed, 27 Sep 2023 15:52:59 +0200 Subject: [PATCH] Fixed some bugs --- backup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index 06ecf24..e70decb 100755 --- a/backup.sh +++ b/backup.sh @@ -97,16 +97,16 @@ make_backup() { echo "Compressing and encrypting backup..." tar -cz -C "$BACKUP_SH_OUTPATH" $BACKUP_SH_FOLDER | \ openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -k "$BACKUP_SH_PASS" \ - > $BACKUP_SH_FILENAME + > "$BACKUP_SH_FILENAME" # Remove temporary files rm -rf "$BACKUP_SH_OUTPUT" # Print file name, file size, file hash and elapsed time, BACKUP_SH_END_TIME="$(date +%s)" - BACKUP_SH_FILE_SIZE="$(ls -l $BACKUP_SH_FILENAME | awk '{print $5}')" - BACKUP_SH_FILE_SIZE_H="$(ls -lh $BACKUP_SH_FILENAME | awk '{print $5}')" - BACKUP_SH_HASH="$(md5sum $BACKUP_SH_FILENAME | awk '{print $1}')" + BACKUP_SH_FILE_SIZE="$(find "$BACKUP_SH_FILENAME" -exec ls -l {} \; | awk '{print $5}')" + BACKUP_SH_FILE_SIZE_H="$(find "$BACKUP_SH_FILENAME" -exec ls -lh {} \; | awk '{print $5}')" + BACKUP_SH_HASH="$(md5sum "$BACKUP_SH_FILENAME" | awk '{print $1}')" echo "File name: $BACKUP_SH_FILENAME" echo "File size: $BACKUP_SH_FILE_SIZE($BACKUP_SH_FILE_SIZE_H)"