This commit is contained in:
Your Name 2023-02-15 07:13:03 -07:00
parent 915ee0b5b4
commit 8aae450fae

View File

@ -71,8 +71,8 @@ create-os-snapshots() {
echo
echo "[Creating new snapshots.....]"
echo
mkdir -p $TARGET/\@$BACKUP_DISK_MAPPER/var/lib/backup
time tar cvpzf $TARGET/\@$BACKUP_DISK_ROOT_NAME/var/lib/backup/$1.tgz --exclude=/volumes/* --exclude=/mnt/* --exclude=/var/tmp/* --exclude=/tmp/* --exclude=/raid/* --exclude=/root/* --exclude=/var/cache/apt/archives/* --exclude=/proc/* --exclude=/.snapshots/* --exclude=$TARGET/* --exclude=/var/lib/libvirt/* --exclude=/dev/* --exclude=/sys/* --exclude=/home/* --exclude=/var/lib/postgresql --exclude=/var/lib/containers /
mkdir -p $TARGET/\@$BACKUP_DISK_MAPPER/var/backups
time tar cvpzf $TARGET/\@$BACKUP_DISK_ROOT_NAME/var/backups/$1.tgz --exclude=/volumes/* --exclude=/mnt/* --exclude=/var/tmp/* --exclude=/tmp/* --exclude=/raid/* --exclude=/root/* --exclude=/var/cache/apt/archives/* --exclude=/proc/* --exclude=/.snapshots/* --exclude=$TARGET/* --exclude=/var/lib/libvirt/* --exclude=/dev/* --exclude=/sys/* --exclude=/home/* --exclude=/var/lib/postgresql --exclude=/var/lib/containers /
}
homeBackup() {
@ -121,7 +121,7 @@ os-backup() {
os-restore() {
partitions
rm -rf $TARGET/usr $TARGET/sbin $TARGET/lib32 $TARGET/libx32 $TARGET/lib $TARGET/vmlinuz* $TARGET/initrd* $TARGET/bin $TARGET/var $TARGET/root $TARGET/opt $TARGET/etc $TARGET/run
tar xfpv /var/lib/backup/$2.tgz -C $TARGET/
tar xfpv /var/backups/$2.tgz -C $TARGET/
if [ "$3" = "home" ]; then
rsync -av --progress --delete /home/ $TARGET/home/