backup: make script rsync instead of tarballing the backup
This commit is contained in:
parent
2a8fe0ad3b
commit
518d3d7692
@ -22,34 +22,11 @@ then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /mnt/disk_b/bk-0.tgz ]
|
mkdir -p /mnt/disk_b/bkd/
|
||||||
then
|
rsync -avxP --delete \
|
||||||
echo "No full archive: preparing to perform complete backup."
|
|
||||||
sleep 5
|
|
||||||
echo "Performing complete backup."
|
|
||||||
|
|
||||||
tar -czv \
|
|
||||||
--exclude={{ dataroot }}/navidrome/cache \
|
--exclude={{ dataroot }}/navidrome/cache \
|
||||||
--exclude={{ dataroot }}/synapse/media_store \
|
--exclude={{ dataroot }}/synapse/media_store \
|
||||||
-f /mnt/disk_b/bk-0.tgz -g /mnt/disk_b/bk.snar /mnt/disk \
|
/mnt/disk/ /mnt/disk_b/bkd/
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
echo "Preparing to unmount backup disk."
|
echo "Preparing to unmount backup disk."
|
||||||
sleep 5
|
sleep 5
|
||||||
|
Reference in New Issue
Block a user