gestion des erreurs à la création d'archives

This commit is contained in:
Djan GICQUEL 2022-06-24 22:27:14 +02:00
parent 71d7566a13
commit be321e0ca8
1 changed files with 19 additions and 19 deletions

View File

@ -76,20 +76,13 @@ BorgFilter () {
# Profils et tests # Profils et tests
################################################################################# #################################################################################
# si $1 n'est pas vide fichier de profil = $1 cd "$dossierprofil"
# sinon afficher les profils disponibles fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \
if [ ! $1 = "" ]; then zenity $W $H $iconborg --list \
fichierprofil="$1" --title "Liste des profils" \
. "$1" --text "Choisir un profil dans la liste" \
else --column "Fichier de profil"\
cd "$dossierprofil" ) && . "$dossierprofil"/"$fichierprofil".conf
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
if [ "$fichierprofil" = "" ]; then if [ "$fichierprofil" = "" ]; then
infoerr=$(echo "Aucun profil choisi.") infoerr=$(echo "Aucun profil choisi.")
@ -122,7 +115,7 @@ fi
# MENU PRINCIPAL Gestion des options du menu # 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ées afficher les entrées de menu «démonter»
# si des archives sont montés, cacher les entrées «supprimer et renommer» # 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à." zenity --warning $W $iconborg --text "L'archive existe déjà."
else else
if [ "$VarDossierPresent" != "false" ];then if [ "$VarDossierPresent" != "false" ];then
cd "$borg_dir" && borg create $borg_excludes $borg_compress "$borg_repo"::"$borg_archive" ./ | ZenityPulsate cd "$borg_dir"
sync | ZenityPulsate log="$HOME/borg-zenity-$borg_archive.log"
zenity --notification --text "Sauvegarde $nomsauvegarde terminée" borg create $borg_excludes $borg_compress "$borg_repo"::"$borg_archive" ./ 2>> "$log" | ZenityPulsate
zenity $W --info --text "Sauvegarde $nomsauvegarde terminée" 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
fi fi