From 6cbc0f60478d809a673b24ce24c627a97a3bf908 Mon Sep 17 00:00:00 2001 From: Cryptoval2 Date: Sun, 14 Dec 2025 19:20:26 -0500 Subject: [PATCH] bug fix --- compress_qcow2.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/compress_qcow2.sh b/compress_qcow2.sh index c6d5ea4..ca07839 100755 --- a/compress_qcow2.sh +++ b/compress_qcow2.sh @@ -17,7 +17,6 @@ mkdir -p ${TmpDir} Qcow2Files=$(find ${Qcow2Dir} -type f -name "*.qcow2" -mtime -1 -print) echo "Files to compress:" echo ${Qcow2Files} -exit for file in ${Qcow2Files} do @@ -53,12 +52,20 @@ do echo "Compression is successful. Compression ratio is ${ratio}%" rm ${SparseFile} + ## *************************************************************************** ## - GuestFile="${ShrunkFile#*.}" - GuestFile="${GuestFile%.shrunk}" - Cmd="ln -snf ${ShrunkFile} /opt/vm_drive/${GuestFile}" - echo ${Cmd} - eval ${Cmd} + ## Switching symlink will mask latest changes for future backups + ## if VM was not restarted. + ## This must be done manually before restarting - pick the latest shrunk + ## symlink it and restart VM + ## + ## *************************************************************************** + + # GuestFile="${ShrunkFile#*.}" + # GuestFile="${GuestFile%.shrunk}" + # Cmd="ln -snf ${ShrunkFile} /opt/vm_drive/${GuestFile}" + # echo ${Cmd} + # eval ${Cmd} ## Cmd="chown oleg:oleg ${ShrunkFile}" echo ${Cmd}