From be321e0ca817ef3e3ac218406278b0ec48afa4dc Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Fri, 24 Jun 2022 22:27:14 +0200 Subject: [PATCH] =?UTF-8?q?gestion=20des=20erreurs=20=C3=A0=20la=20cr?= =?UTF-8?q?=C3=A9ation=20d'archives?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 875efca..64de26e 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -76,20 +76,13 @@ BorgFilter () { # Profils et tests ################################################################################# -# si $1 n'est pas vide fichier de profil = $1 -# sinon afficher les profils disponibles -if [ ! $1 = "" ]; then - fichierprofil="$1" - . "$1" -else - cd "$dossierprofil" - fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \ - zenity $W $H $iconborg --list \ - --title "Liste des profils" \ - --text "Choisir un profil dans la liste" \ - --column "Fichier de profil"\ - ) && . "$dossierprofil"/"$fichierprofil".conf -fi +cd "$dossierprofil" +fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \ +zenity $W $H $iconborg --list \ +--title "Liste des profils" \ +--text "Choisir un profil dans la liste" \ +--column "Fichier de profil"\ +) && . "$dossierprofil"/"$fichierprofil".conf if [ "$fichierprofil" = "" ]; then infoerr=$(echo "Aucun profil choisi.") @@ -122,7 +115,7 @@ fi # MENU PRINCIPAL Gestion des options du menu ################################################################################# -while [ ! "$quitter" = "yes" ];do +while [ "$quitter" != "yes" ];do # si des archives sont montées afficher les entrées de menu «démonter» # si des archives sont montés, cacher les entrées «supprimer et renommer» @@ -204,10 +197,17 @@ fi zenity --warning $W $iconborg --text "L'archive existe déjà." else if [ "$VarDossierPresent" != "false" ];then - cd "$borg_dir" && borg create $borg_excludes $borg_compress "$borg_repo"::"$borg_archive" ./ | ZenityPulsate - sync | ZenityPulsate - zenity --notification --text "Sauvegarde $nomsauvegarde terminée" - zenity $W --info --text "Sauvegarde $nomsauvegarde terminée" + cd "$borg_dir" + log="$HOME/borg-zenity-$borg_archive.log" + borg create $borg_excludes $borg_compress "$borg_repo"::"$borg_archive" ./ 2>> "$log" | ZenityPulsate + chmod 777 "$log" + if ls "$log" ;then + zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" + else + sync | ZenityPulsate + zenity --notification --text "Sauvegarde $nomsauvegarde terminée" + zenity $W --info --text "Sauvegarde $nomsauvegarde terminée" + fi fi fi