Si le dossier source est absent, retour au menu

This commit is contained in:
Djan GICQUEL 2021-07-18 20:33:01 +02:00
parent a9b50e79ad
commit 27c9b1dd89
1 changed files with 4 additions and 2 deletions

View File

@ -50,9 +50,9 @@ bobainfoa () {
DossierPresent () { DossierPresent () {
if [ ! -d "$1" ]; then if [ ! -d "$1" ]; then
inforerror=$(echo "Erreur, le dossier $1 est absent.\nFin du script.") inforerror=$(echo "Erreur, le dossier $1 est absent.")
zenity --width=600 --error --text="$inforerror" zenity --width=600 --error --text="$inforerror"
exit VarDossierPresent="false"
fi fi
} }
@ -120,10 +120,12 @@ if [ "$choixmenu" = "cs" ] ;then
DossierPresent $borg_repo DossierPresent $borg_repo
DossierPresent $borg_dir DossierPresent $borg_dir
if [ "$VarDossierPresent" != "false" ];then
borg create $borg_excludes $borg_compress $borg_repo::$borg_archive $borg_dir | zenity --width=600 --progress --pulsate --auto-close --title="Sauvegarde en cours..." borg create $borg_excludes $borg_compress $borg_repo::$borg_archive $borg_dir | zenity --width=600 --progress --pulsate --auto-close --title="Sauvegarde en cours..."
sync | zenity --width=600 --progress --pulsate --auto-close --title="Synchronisation des écritures..." sync | zenity --width=600 --progress --pulsate --auto-close --title="Synchronisation des écritures..."
zenity --notification --text "Sauvegarde $nomsauvegarde terminée" zenity --notification --text "Sauvegarde $nomsauvegarde terminée"
zenity --width=600 --info --text "Sauvegarde $nomsauvegarde terminée" zenity --width=600 --info --text "Sauvegarde $nomsauvegarde terminée"
fi
elif [ "$choixmenu" = "ms" ];then elif [ "$choixmenu" = "ms" ];then
# Monter une archive # Monter une archive