Added gentoo-backup.sh script for making stage4 backups

This commit is contained in:
Eric Renfro 2024-08-02 12:09:55 -04:00
parent 0a16b493cb
commit d0e7c0f863
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM

21
gentoo-backup.sh Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
bhost="$(hostname -s)"
bdate="$(date +"%Y%m%d")"
if [[ ! -d "/var/backup" ]]; then
mkdir /var/backup
fi
pushd /var/backup &>/dev/null || exit 2
mkstage4 -s -l -q -C zst \
-e "/var/lib/containers/*" \
-e "/var/lib/machines/*" \
-e "/var/lib/portables/*" \
-e "/var/lib/libvirt/*" \
-e "/var/cache/binpkgs/*" \
-e "/home/*/*" \
"$bhost-stage4"
popd &>/dev/null || exit 2