55 lines
1.8 KiB
Bash
Executable File
55 lines
1.8 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 in einer scrollbaren Anzeige auszugeben
|
|
function show_repo_info() {
|
|
borg info "$REPO" > /tmp/repo_info.txt 2>&1
|
|
dialog --title "Repository-Informationen" --backtitle "Borg Backup" --scrollbar --textbox /tmp/repo_info.txt 25 80
|
|
rm /tmp/repo_info.txt
|
|
}
|
|
|
|
function list_archives() {
|
|
borg list "$REPO" > /tmp/archive_list.txt 2>&1
|
|
dialog --title "Verfügbare Archive" --backtitle "Borg Backup" --scrollbar --textbox /tmp/archive_list.txt 25 80
|
|
rm /tmp/archive_list.txt
|
|
}
|
|
|
|
function show_archive_details() {
|
|
ARCHIVE=$(whiptail --inputbox "Gib den Namen des Archivs ein:" 8 40 --title "Borg Backup" 3>&1 1>&2 2>&3)
|
|
borg info "$REPO::$ARCHIVE" > /tmp/archive_info.txt 2>&1
|
|
dialog --title "Details zu Archiv $ARCHIVE" --backtitle "Borg Backup" --scrollbar --textbox /tmp/archive_info.txt 25 80
|
|
rm /tmp/archive_info.txt
|
|
}
|
|
|
|
# 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
|