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)"