52 lines
1.6 KiB
Bash
Executable File
52 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Setze Backup-Parameter
|
|
REPO="ssh://stefan@172.25.28.34:22/srv/usbplatte/nauheim1vps"
|
|
clear
|
|
|
|
# Frage die Passphrase einmal ab
|
|
PASSPHRASE=$(whiptail --passwordbox "Bitte gib die Passphrase für das Borgbackup-Repository ein:" 8 40 --title "Borg Backup" 3>&1 1>&2 2>&3)
|
|
export BORG_PASSPHRASE="$PASSPHRASE"
|
|
|
|
# Funktion, um Informationen schön in Whiptail anzuzeigen
|
|
function show_repo_info() {
|
|
INFO=$(borg info $REPO 2>&1)
|
|
whiptail --msgbox "Repository-Informationen:\n\n$INFO" 20 70 --title "Borg Backup"
|
|
}
|
|
|
|
function list_archives() {
|
|
ARCHIVES=$(borg list $REPO 2>&1)
|
|
whiptail --msgbox "Verfügbare Archive:\n\n$ARCHIVES" 20 70 --title "Borg Backup"
|
|
}
|
|
|
|
function show_archive_details() {
|
|
ARCHIVE=$(whiptail --inputbox "Gib den Namen des Archivs ein:" 8 40 --title "Borg Backup" 3>&1 1>&2 2>&3)
|
|
INFO=$(borg info $REPO::$ARCHIVE 2>&1)
|
|
whiptail --msgbox "Details zu Archiv $ARCHIVE:\n\n$INFO" 20 70 --title "Borg Backup"
|
|
}
|
|
|
|
# Hauptmenü mit Whiptail
|
|
while true; do
|
|
OPTION=$(whiptail --title "Borg Backup Menü" --menu "Wähle eine Option" 15 50 4 \
|
|
"1" "Repository-Informationen anzeigen" \
|
|
"2" "Liste aller Archive anzeigen" \
|
|
"3" "Details zu einem bestimmten Archiv anzeigen" \
|
|
"4" "Beenden" 3>&1 1>&2 2>&3)
|
|
|
|
case $OPTION in
|
|
1)
|
|
show_repo_info
|
|
;;
|
|
2)
|
|
list_archives
|
|
;;
|
|
3)
|
|
show_archive_details
|
|
;;
|
|
4)
|
|
whiptail --msgbox "Beende das Skript." 8 40 --title "Borg Backup"
|
|
exit 0
|
|
;;
|
|
esac
|
|
done
|