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
#################################################################################
# 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