forked from DerDanilo/proxmox-stuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prox_config_restore.sh
executable file
·35 lines (24 loc) · 872 Bytes
/
prox_config_restore.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Version 0.2.3
# Date 04.18.2022
# Author razem-io
# Contributors
# Very basic restore script based on https:/DerDanilo/proxmox-stuff/issues/5
# Restores backup from prox_config_backup.sh
# example: prox_config_restore.sh proxmox_backup_proxmoxhostname_2017-12-02.15.48.10.tar.gz
set -e
if [[ $# -eq 0 ]] ; then
echo 'Argument missing -> restore.sh proxmox_backup_proxmoxhostname_2017-12-02.15.48.10.tar.gz'
exit 0
fi
FOLDER_1="./$1_1"
FOLDER_2="./$1_2"
mkdir "$FOLDER_1"
mkdir "$FOLDER_2"
tar -zxvf $1 -C "$FOLDER_1"
find "$FOLDER_1" -name "*tar" -exec tar xvf '{}' -C "$FOLDER_2" \;
for i in pve-cluster pvedaemon vz qemu-server; do systemctl stop $i ; done || true
cp -avr $FOLDER_2/. /
rm -r "$FOLDER_1" "$FOLDER_2" || true
read -p "Restore complete. Hit 'Enter' to reboot or CTRL+C to cancel."
reboot