Modification du fichier desktop : suppression du "sh"

Ajout de zenity pulsate pour les opérations longues
(monter/démonter/informations archives)
This commit is contained in:
Djan GICQUEL 2021-05-08 14:35:22 +02:00
parent 383bbf87ba
commit 911395701f
2 changed files with 36 additions and 8 deletions

View File

@ -6,6 +6,12 @@ if [ "$?" != "0" ]; then
exit
fi
which borg
if [ "$?" != "0" ]; then
echo "borgbackup n'est pas installé.";exit
exit
fi
# META VARIABLES
#################################################################################
export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
@ -59,10 +65,14 @@ if [ ! $1 = "" ]; then
. "$1"
else
cd $dossierprofil
fichierprofil=$(ls -1 *.txt | zenity --height=500 --width=600 --list --title "Profils" --hide-header --column "profil") && . $fichierprofil
fichierprofil=$(ls -1 *.txt | zenity --height=500 --width=600 --list --title "Liste des profils" --hide-header --column "profil") && . $fichierprofil
fi
if [ "$nomsauvegarde" = "" ]; then
if [ "$fichierprofil" = "" ]; then
infoerr=$(echo "Aucun profil choisi.")
zenity --width=600 --error --text="$infoerr"
exit
elif [ "$nomsauvegarde" = "" ]; then
infoerr=$(echo "Nom de sauvegarde non défini.")
zenity --width=600 --error --text="$infoerr"
exit
@ -100,6 +110,8 @@ qu\nQuitter\
--hide-header --hide-column=1 --column "id" --column "choix")
if [ "$choixmenu" = "cs" ] ;then
# Créer une archive
TestBorgRepo
DossierPresent $borg_repo
@ -114,32 +126,48 @@ if [ "$choixmenu" = "cs" ] ;then
zenity --width=600 --info --text "Sauvegarde $nomsauvegarde terminée"
elif [ "$choixmenu" = "ed" ] ;then
# Espace disque utilisé
espacedisqueutil=$(df -k --output=pcent $borg_repo | tail -n +2)
zenity --width=600 --info --text "Espace disque utilisé : $espacedisqueutil"
elif [ "$choixmenu" = "ms" ];then
# Monter une archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
mkdir $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive
borg mount $borg_repo::$borg_archive $HOME/$borg_archive | zenity --width=600 --progress --pulsate --auto-close
zenity --width=600 --info --text="La sauvegarde est disponible dans le dossier\n<tt>$HOME/$borg_archive</tt>"
elif [ "$choixmenu" = "dm" ];then
# Demonter une archive
ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity --width=500 --height=400 --list --title "Liste des points de montages" --column "")
fusermount -u $ptnmontage && sleep 5 && rmdir $ptnmontage
fusermount -u $ptnmontage | zenity --width=600 --progress --pulsate --auto-close
sleep 5 | zenity --width=600 --progress --pulsate --auto-close
rmdir $ptnmontage | zenity --width=600 --progress --pulsate --auto-close
elif [ "$choixmenu" = "ss" ];then
# Supprimmer une archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
borg delete $borg_repo::$borg_archive | zenity --width=600 --progress --pulsate --auto-close --title="Suppression en cours..."
borg delete $borg_repo::$borg_archive | zenity --width=600 --progress --pulsate --auto-close
zenity --width=600 --info --text="Suppresion de l'archive $borg_archive terminée"
elif [ "$choixmenu" = "is" ];then
# Information archive
borg_archive=$(borg list --short $borg_repo | zenity --height=500 --list --title "Listes des archives" --column "Archive")
zenity --width=600 --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>"
zenity --width=600 --info --text="<tt>$(borg info $borg_repo::$borg_archive)</tt>" | zenity --width=600 --progress --pulsate --auto-close
elif [ "$choixmenu" = "id" ];then
zenity --width=600 --info --text="<tt>$(borg info $borg_repo)</tt>"
# Information sur le dépôt
zenity --width=600 --info --text="<tt>$(borg info $borg_repo)</tt>" | zenity --width=600 --progress --pulsate --auto-close --title="Récupération des informations..."
elif [ "$choixmenu" = "ap" ];then
# Afficher le profil
zenity --width=600 --height=400 --info --text="<tt>$(cd $dossierprofil && cat $fichierprofil)</tt>"
elif [ "$choixmenu" = "" ];then

View File

@ -1,6 +1,6 @@
[Desktop Entry]
Name=Sauvegarde BORG GUI
Exec=sh bin/git/borg-zenity/borg-gui.sh
Exec=bin/borg-zenity/borg-gui.sh
Icon=borg
Type=Application
Categories=Utility;