From 7c128e98a046cd7cfe7c7ea4a67a3cbf050bcc5e Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Mon, 20 Jun 2022 09:38:35 -0400 Subject: [PATCH] backup: fix tar usage --- roles/backup/templates/lbk.sh.j2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/backup/templates/lbk.sh.j2 b/roles/backup/templates/lbk.sh.j2 index df101f5..b3ff10c 100644 --- a/roles/backup/templates/lbk.sh.j2 +++ b/roles/backup/templates/lbk.sh.j2 @@ -27,7 +27,12 @@ then echo "No full archive: preparing to perform complete backup." sleep 5 echo "Performing complete backup." - tar -czvf /mnt/disk_b/bk-0.tgz -g /mnt/disk_b/bk.snar /mnt/disk + + tar -czv \ + --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 @@ -36,7 +41,12 @@ else sleep 5. echo "Performing incremental backup." cp /mnt/disk_b/bk.snar "/mnt/disk_b/bk-$LABEL.snar" - tar -czvf /mnt/disk_b/bk-0.tgz -g /mnt/disk_b/bk.snar /mnt/disk + + 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