From 518d3d769218115262f45adf399e828de9bb61a1 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 25 Dec 2022 21:44:17 -0500 Subject: [PATCH] backup: make script rsync instead of tarballing the backup --- roles/backup/templates/lbk.sh.j2 | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/roles/backup/templates/lbk.sh.j2 b/roles/backup/templates/lbk.sh.j2 index b3ff10c..1726ea4 100644 --- a/roles/backup/templates/lbk.sh.j2 +++ b/roles/backup/templates/lbk.sh.j2 @@ -22,34 +22,11 @@ then exit fi -if [ ! -f /mnt/disk_b/bk-0.tgz ] -then - echo "No full archive: preparing to perform complete backup." - sleep 5 - echo "Performing complete backup." - - tar -czv \ +mkdir -p /mnt/disk_b/bkd/ +rsync -avxP --delete \ --exclude={{ dataroot }}/navidrome/cache \ --exclude={{ dataroot }}/synapse/media_store \ - -f /mnt/disk_b/bk-0.tgz -g /mnt/disk_b/bk.snar /mnt/disk \ - - echo "Backup finished." - tput bel -else - LABEL=$(date +"%Y_%m_%d") - echo "Preparing to perform incremental backup: $LABEL" - sleep 5. - echo "Performing incremental backup." - cp /mnt/disk_b/bk.snar "/mnt/disk_b/bk-$LABEL.snar" - - tar -czv \ - --exclude={{ dataroot }}/navidrome/cache \ - --exclude={{ dataroot }}/synapse/media_store \ - -f "/mnt/disk_b/bk-$LABEL.tgz" -g "/mnt/disk_b/bk-$LABEL.snar" /mnt/disk \ - - echo "Backup finished." - tput bel -fi + /mnt/disk/ /mnt/disk_b/bkd/ echo "Preparing to unmount backup disk." sleep 5