From 575cd9eed21443d78ceda5d73d56fde66307a703 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Mon, 2 May 2022 08:13:55 +0200 Subject: [PATCH 01/53] changement de menu --- profile-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile-manager.sh b/profile-manager.sh index 884fad8..bbb4eb0 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -41,7 +41,7 @@ mkdir -p $dossierprofil && cd $dossierprofil choixmenu=$(echo -e "\ cp\nCréer un nouveau profil/dépôt\n\ -ajd\nAjouter un dépôt\n\ +ajd\nAjouter un dépôt existant\n\ ap\nAfficher les profils\ " | zenity $H $W --window-icon=$HOME/.icons/borg.svg --list \ --column "id" --column "choix") From eaa29a84263252d3d65876889124430c0f2a736d Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 26 May 2022 10:10:44 +0200 Subject: [PATCH 02/53] =?UTF-8?q?ajout=20du=20code=20pour=20g=C3=A9rer=20D?= =?UTF-8?q?ebian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index ff654b7..96ff508 100644 --- a/install.sh +++ b/install.sh @@ -1,16 +1,40 @@ #! /bin/bash + . testdistro.sh + # Borg zenity install and update -which zenity -if [ "$?" != "0" ]; then - bash testdistro.sh || exit +if [[ "$OS" =~ "Fedora" ]];then +echo "Fedora detecté" +sudo dnf install borgbackup zenity + +elif [[ "$OS" =~ "Debian" ]];then +echo "Debian detecté" +su -c "apt-get -y install borgbackup zenity" + +elif [[ "$OS" =~ "Ubuntu" ]];then +echo "Ubuntu detecté" +sudo apt-get install -y borgbackup zenity + +elif [[ "$OS" =~ "Linux Mint" ]];then +echo "Linux Mint detecté" +sudo apt-get install -y borgbackup zenity + +elif [[ "$OS" =~ "Manjaro" ]];then +echo "Manjaro detecté" +sudo pacman -Sy borgbackup zenity fi -which borg -if [ "$?" != "0" ]; then - bash testdistro.sh || exit -fi +if [[ "$OS" =~ "Debian" ]];then +su -c "mkdir -vp /opt/borg-zenity" +su -c "cp -fv icons/borg.svg /usr/share/icons/" +su -c "cp -fv icons/borgzenity-profils.svg /usr/share/icons/" +su -c "cp -fv icons/borgzenity-sauvegarde.svg /usr/share/icons/" +su -c "cp -fv borg-zenity-sauvegarde.desktop /usr/share/applications/" +su -c "cp -fv borg-zenity-gestprofils.desktop /usr/share/applications/" +su -c "cp -fv borg-gui.sh /opt/borg-zenity/" +su -c "cp -fv profile-manager.sh /opt/borg-zenity/" +else # Copie des fichiers sudo mkdir -vp /opt/borg-zenity sudo cp -fv icons/borg.svg /usr/share/icons/ @@ -20,15 +44,23 @@ sudo cp -fv borg-zenity-sauvegarde.desktop /usr/share/applications/ sudo cp -fv borg-zenity-gestprofils.desktop /usr/share/applications/ sudo cp -fv borg-gui.sh /opt/borg-zenity/ sudo cp -fv profile-manager.sh /opt/borg-zenity/ +fi # réglages des droits +if [[ "$OS" =~ "Debian" ]];then +su -c "chmod a+rx /opt/borg-zenity/borg-gui.sh" +su -c "chmod a+rx /opt/borg-zenity/profile-manager.sh" + +else sudo chmod a+rx /opt/borg-zenity/borg-gui.sh sudo chmod a+rx /opt/borg-zenity/profile-manager.sh +fi # Création du fichier de configuration de base mkdir -vp $HOME/.config/borg/ cp -fv borg-zenity.conf $HOME/.config/borg/ +# nettoyage if [ -f readme.md ];then cd ..;fi if [ -f borg-zenity.zip ];then rm -v borg-zenity.zip;fi if [ -d borg-zenity ];then rm -rv borg-zenity;fi From bcdb53cb2d5926679668a187dabb3fb2810019a9 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 26 May 2022 10:12:51 +0200 Subject: [PATCH 03/53] =?UTF-8?q?exclusion=20des=20dossier=20cache=20par?= =?UTF-8?q?=20d=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile-manager.sh b/profile-manager.sh index bbb4eb0..842ff91 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -92,7 +92,7 @@ nomsauvegarde="$nomsauvegarde" borg_repo="$borg_repo" borg_archive="\$(date +%d_%B_%Y_%H-%M)" borg_dir="$borg_dir" -borg_excludes="" +borg_excludes="--exclude=*cache*" borg_compress="" dryrun="" EOF From 025e3ec978488b1a58b6ef6dbc24e1ae7355e4e4 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 26 May 2022 10:13:35 +0200 Subject: [PATCH 04/53] suppression du manuel d'utilisation, inutile sur la version de dev --- readme.md | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/readme.md b/readme.md index e338a6b..e21dff7 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,4 @@ - -# Borg Zenity +# Borg Zenity Une interface graphique en français pour BorgBackup. @@ -15,31 +14,3 @@ wget -O borg-zenity.zip https://git.djan-gicquel.fr/borg-zenity/zipball/dev && u ``` Cette commande va télécharger les fichiers d'installation et exécuter le script d'installation. -Vous devrez entrer votre mot de passe administrateur et répondre oui ou Y ou YES lorsque le gestionnaire de paquet de votre distribution vous demandera d'installer les paquets `borgbackup` et `zenity`. - -Une fois l’installation terminée vous pouvez supprimmer le fichier `borg-zenity.zip` et le dossier `borg-zenity`. - -## Gestionnaire de profils -![icône gestionnaire de profils](https://git.djan-gicquel.fr/borg-zenity/raw/dev/captures/icone_profils.png) - -Si vous n'utilisez pas encore `borgbackup` (ce qui normalement est le cas), il faudra tout d'abord créer un profil de sauvegarde. -Pour cela utiliser l’icône "Borg Zenity Profils" dans votre menu principal et sélectionnez «Créer un nouveau profil/dépôt». -Sélectionnez le dossier dans lequel sera créé le dépôt. C'est l'emplacement de votre sauvegarde, en général on utilise un disque dur externe. -Puis répondez à la question concernant le chiffrement du dépôt. Les fichiers du dépôt sont initialisés. -Sélectionnez ensuite un dossier à sauvegarder puis choisissez un nom de profil. Celui-ci sera stocké comme fichier donc évitez si possible les espaces et les caractères spéciaux. - -Il n'est pour l'instant pas possible de supprimer un profil via l'interface car la suppression laisserait des traces dans la configuration de borgbackup. -Pour supprimer un dépôt, rendez-vous dans le dossier du dépôt, ouvrez un terminal et tapez `borg delete .` puis validez avec "YES" si vous êtes sur de vous. Le dépôt sera supprimé proprement. Il faudra également supprimer le fichier de profil dans `~/.config/borg/` pour qu'il n'apparaisse plus dans borg-zenity. - - -## Interface principale -![icône interface principale](https://git.djan-gicquel.fr/borg-zenity/raw/dev/captures/icone_sauvegarde.png) - -Pour lancer l'interface principale cliquez sur l'icône «Borg Zenity Sauvegarde» dans le menu et sélectionnez le profil voulu. -En vocabulaire borg, une archive est une sauvegarde. - -Pour créer une sauvegarde cliquez sur «Créer une archive». La première sauvegarde prendra du temps, les suivantes seront plus rapide. - -Pour voir le contenu d'une archive déjà sauvegardée cliquez sur «Monter une archive». Un nouveau dossier sera créé en lecture seule dans votre dossier maison. Il contiendra les fichiers de l'archive. Pensez à démonter l'archive dans le menu correspondant avant de quitter Borg Zenity. - -Pour quitter Borg Zenity sélectionnez «QUITTER» puis validez ceci afin pouvoir faire quelques tests avant de quitter le logiciel. From 58f75f3d0b29434af3b73b6c3674289b7bf15058 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 26 May 2022 10:14:20 +0200 Subject: [PATCH 05/53] testdistro.sh ne fait plus d'installation, uniquement les tests --- testdistro.sh | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/testdistro.sh b/testdistro.sh index 98bcff0..83a91e1 100755 --- a/testdistro.sh +++ b/testdistro.sh @@ -24,41 +24,10 @@ elif [ -f /etc/SuSe-release ]; then elif [ -f /etc/redhat-release ]; then # Older Red Hat, CentOS, etc. OS=Redhat -else - echo "La distribution n'a pas été détecté." - echo "Installez les paquets \"borgbackup\" et \"zenity\" manuellement." - exit fi -echo "OS = $OS" - -if [[ "$OS" =~ "Fedora" ]];then -echo "Fedora detecté" -sudo dnf install borgbackup zenity - -elif [[ "$OS" =~ Mageia ]];then -# non fonctionnel sur Mageia 8, le paquet borgbackup n'existe pas encore -echo "Mageia detecté" -su -c "dnf install borgbackup zenity" - -elif [[ "$OS" =~ Debian ]];then -echo "Debian detecté" -su -c apt install -y borgbackup zenity - -elif [[ "$OS" =~ Ubuntu ]];then -echo "Ubuntu detecté" -sudo apt install -y borgbackup zenity - -elif [[ "$OS" =~ "Linux Mint" ]];then -echo "Linux Mint detecté" -sudo apt install -y borgbackup zenity - -elif [[ "$OS" =~ Manjaro ]];then -echo "Manjaro detecté" -sudo pacman -Sy borgbackup zenity - -else - echo "La distribution n'a pas été détecté." - echo "Installez les paquets \"borgbackup\" et \"zenity\" manuellement." - exit -fi \ No newline at end of file +if [ "$OS" = "" ];then +echo "La distribution n'a pas été détecté." +echo "Installez les paquets \"borgbackup\" et \"zenity\" manuellement." +exit +fi From 2a347681f922980faa807ec4af45982724ea0077 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 26 May 2022 10:16:44 +0200 Subject: [PATCH 06/53] suppression du fichier d'exemple de profil --- profil_exemple.conf | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 profil_exemple.conf diff --git a/profil_exemple.conf b/profil_exemple.conf deleted file mode 100755 index 90a6e20..0000000 --- a/profil_exemple.conf +++ /dev/null @@ -1,6 +0,0 @@ -nomsauvegarde="" -borg_repo="" -borg_archive="$(date +%d_%B_%Y)" -borg_dir="" -borg_excludes="" -borg_compress="--compress zlib,5" From 85da88a777c0549a6141072a2d9f2ae6eb8e6b07 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 29 May 2022 15:42:11 +0200 Subject: [PATCH 07/53] =?UTF-8?q?ajout=20d'ic=C3=B4nes=20dans=20le=20menu?= =?UTF-8?q?=20principal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 8433465..a5fe4a8 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -126,7 +126,7 @@ while [ ! "$quitter" = "yes" ];do # si aucune archive n'est montée, cacher l'entrée de menu «Démonter une archive» if [ "$(mount | grep borgfs)" != "" ];then -MenuDemonter="dm\nDémonter une archive\ndmt\nDémonter toutes les archives\n" +MenuDemonter="dm\n🗀 Démonter une archive\ndmt\n🗀🗀 Démonter toutes les archives\n" else MenuDemonter="" fi @@ -134,7 +134,7 @@ fi # afficher l'espace disque sous condition, la variable vient du fichier borg-zenity.conf EspaceDisqueUtil=$(df -k --output=pcent $borg_repo | tail -n +2 | cut -d% -f1) if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then -MenuEspaceDisque="ed\n/!\ Espace disque utilisé : $EspaceDisqueUtil %\n" +MenuEspaceDisque="ed\n⚠ Espace disque utilisé : $EspaceDisqueUtil %\n" else MenuEspaceDisque="" fi @@ -145,32 +145,32 @@ fi if [ $menu_avance = "true" ];then choixmenu=$(echo -e "\ -cs\nCréer l'archive : $(echo $borg_archive)\n\ -ms\nMonter une archive\n\ +cs\n🖫 Créer l'archive : $(echo $borg_archive)\n\ +ms\n🗁 Monter une archive\n\ $(echo $MenuDemonter)\ -ss\nSupprimer une archive\n\ -sss\nSupprimer des archives\n\ -ra\nRenommer une archive\n\ -is\nInformation archive\n\ -fi\nFiltre : "$filter"\n\ +ss\n❌ Supprimer une archive\n\ +sss\n❌❌ Supprimer des archives\n\ +ra\n🖹 Renommer une archive\n\ +is\n❔ Information archive\n\ +fi\n☑ Filtre : "$filter"\n\ --\n------------------------------------------\n\ -id\nInformation sur le dépôt\n\ -ap\nAfficher le profil\n\ +id\n❔ Information sur le dépôt\n\ +ap\n❔ Afficher le profil\n\ --\n------------------------------------------\n\ $(echo $MenuEspaceDisque)\ -qu\nQUITTER\ +qu\n⏻ QUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") else choixmenu=$(echo -e "\ -cs\nCréer l'archive : $(echo $borg_archive)\n\ -ms\nMonter une archive\n\ +cs\n🖫 Créer l'archive : $(echo $borg_archive)\n\ +ms\n🗁 Monter une archive\n\ $(echo $MenuDemonter)\ -ss\nSupprimer une archive\n\ -is\nInformation archive\n\ +ss\n❌ Supprimer une archive\n\ +is\n❔ Information archive\n\ $(echo $MenuEspaceDisque)\ -qu\nQUITTER\ +qu\n⏻ QUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") fi From 96fdf3968156fe52bbe53981ef5144b301433428 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 29 May 2022 17:44:22 +0200 Subject: [PATCH 08/53] =?UTF-8?q?suppression=20des=20ic=C3=B4nes=20(non=20?= =?UTF-8?q?prise=20en=20charge=20d'UTF8=20sur=20certains=20syst=C3=A8me)?= =?UTF-8?q?=20remplacement=20des=20ic=C3=B4nes=20par=20des=20caract=C3=A8r?= =?UTF-8?q?es=20sp=C3=A9ciaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index a5fe4a8..c40d13f 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -126,7 +126,7 @@ while [ ! "$quitter" = "yes" ];do # si aucune archive n'est montée, cacher l'entrée de menu «Démonter une archive» if [ "$(mount | grep borgfs)" != "" ];then -MenuDemonter="dm\n🗀 Démonter une archive\ndmt\n🗀🗀 Démonter toutes les archives\n" +MenuDemonter="dm\n[▼] Démonter une archive\ndmt\n[▼▼] Démonter toutes les archives\n" else MenuDemonter="" fi @@ -134,7 +134,7 @@ fi # afficher l'espace disque sous condition, la variable vient du fichier borg-zenity.conf EspaceDisqueUtil=$(df -k --output=pcent $borg_repo | tail -n +2 | cut -d% -f1) if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then -MenuEspaceDisque="ed\n⚠ Espace disque utilisé : $EspaceDisqueUtil %\n" +MenuEspaceDisque="ed\n/!\ Espace disque utilisé : $EspaceDisqueUtil %\n" else MenuEspaceDisque="" fi @@ -145,32 +145,32 @@ fi if [ $menu_avance = "true" ];then choixmenu=$(echo -e "\ -cs\n🖫 Créer l'archive : $(echo $borg_archive)\n\ -ms\n🗁 Monter une archive\n\ +cs\n[+] Créer l'archive : $(echo $borg_archive)\n\ +ms\n[▲] Monter une archive\n\ $(echo $MenuDemonter)\ -ss\n❌ Supprimer une archive\n\ -sss\n❌❌ Supprimer des archives\n\ -ra\n🖹 Renommer une archive\n\ -is\n❔ Information archive\n\ -fi\n☑ Filtre : "$filter"\n\ +ss\n[X] Supprimer une archive\n\ +sss\n[XX] Supprimer des archives\n\ +ra\n[I] Renommer une archive\n\ +is\n[?] Information archive\n\ +fi\n[*] Filtre : "$filter"\n\ --\n------------------------------------------\n\ -id\n❔ Information sur le dépôt\n\ -ap\n❔ Afficher le profil\n\ +id\n[?] Information sur le dépôt\n\ +ap\n[?] Afficher le profil\n\ --\n------------------------------------------\n\ $(echo $MenuEspaceDisque)\ -qu\n⏻ QUITTER\ +qu\n[Q] QUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") else choixmenu=$(echo -e "\ -cs\n🖫 Créer l'archive : $(echo $borg_archive)\n\ -ms\n🗁 Monter une archive\n\ +cs\n[+] Créer l'archive : $(echo $borg_archive)\n\ +ms\n[^] Monter une archive\n\ $(echo $MenuDemonter)\ -ss\n❌ Supprimer une archive\n\ -is\n❔ Information archive\n\ +ss\n[X] Supprimer une archive\n\ +is\n[?] Information archive\n\ $(echo $MenuEspaceDisque)\ -qu\n⏻ QUITTER\ +qu\n[Q] QUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") fi From 4d1e2fd9a2847d4f51a88be3c8339d1bbf1110bf Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 29 May 2022 18:00:10 +0200 Subject: [PATCH 09/53] =?UTF-8?q?cacher=20certaines=20entr=C3=A9es=20de=20?= =?UTF-8?q?menu=20si=20des=20archives=20sont=20mont=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index c40d13f..49dcd27 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -124,11 +124,20 @@ fi while [ ! "$quitter" = "yes" ];do -# si aucune archive n'est montée, cacher l'entrée de menu «Démonter une archive» +# 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» if [ "$(mount | grep borgfs)" != "" ];then MenuDemonter="dm\n[▼] Démonter une archive\ndmt\n[▼▼] Démonter toutes les archives\n" +MenuSupprimer="" +MenuRenommer="" +MenuInfo="" +MenuCreer="" else MenuDemonter="" +MenuSupprimer="ss\n[X] Supprimer une archive\nsss\n[XX] Supprimer des archives\n" +MenuRenommer="ra\n[I] Renommer une archive\n" +MenuInfo="is\n[?] Information archive\n" +MenuCreer="cs\n[+] Créer l'archive : $(echo $borg_archive)\n" fi # afficher l'espace disque sous condition, la variable vient du fichier borg-zenity.conf @@ -145,13 +154,12 @@ fi if [ $menu_avance = "true" ];then choixmenu=$(echo -e "\ -cs\n[+] Créer l'archive : $(echo $borg_archive)\n\ +$(echo $MenuCreer)\ ms\n[▲] Monter une archive\n\ $(echo $MenuDemonter)\ -ss\n[X] Supprimer une archive\n\ -sss\n[XX] Supprimer des archives\n\ -ra\n[I] Renommer une archive\n\ -is\n[?] Information archive\n\ +$(echo $MenuSupprimer)\ +$(echo $MenuRenommer)\ +$(echo $MenuInfo)\ fi\n[*] Filtre : "$filter"\n\ --\n------------------------------------------\n\ id\n[?] Information sur le dépôt\n\ @@ -164,11 +172,11 @@ qu\n[Q] QUITTER\ else choixmenu=$(echo -e "\ -cs\n[+] Créer l'archive : $(echo $borg_archive)\n\ -ms\n[^] Monter une archive\n\ +$(echo $MenuCreer)\ +ms\n[▲] Monter une archive\n\ $(echo $MenuDemonter)\ -ss\n[X] Supprimer une archive\n\ -is\n[?] Information archive\n\ +$(echo $MenuSupprimer)\ +$(echo $MenuInfo)\ $(echo $MenuEspaceDisque)\ qu\n[Q] QUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ From 13d97442bfb648eeade60be9bf7fa708285aef79 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Fri, 3 Jun 2022 21:27:27 +0200 Subject: [PATCH 10/53] =?UTF-8?q?correction=20de=20l'adresse=20du=20zip=20?= =?UTF-8?q?apr=C3=A8s=20passage=20=C3=A0=20gitea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e21dff7..14374bd 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,7 @@ S'il n'y parvient pas vous devrez les installer manuellement. Avant tout sachez que la version dans la branche `dev` est encore en test. L'installation devrait pouvoir se faire en une ligne de commande. Copiez ceci dans votre terminal. ``` -wget -O borg-zenity.zip https://git.djan-gicquel.fr/borg-zenity/zipball/dev && unzip -d borg-zenity borg-zenity.zip && cd borg-zenity && bash install.sh +wget -O borg-zenity.zip https://git.djan-gicquel.fr/djan/borg-zenity/archive/dev.zip && unzip -d borg-zenity borg-zenity.zip && cd borg-zenity && bash install.sh ``` Cette commande va télécharger les fichiers d'installation et exécuter le script d'installation. From 7a55bb867d513494c96d1eb10bcaa4a1529356c0 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 23 Jun 2022 17:48:27 +0200 Subject: [PATCH 11/53] echappement des variables --- profile-manager.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index 842ff91..c20fa5e 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -2,6 +2,8 @@ # Fonctions et variables ########################################################### +W="--width=600" +H="--height=500" ZenityPulsate () { zenity $W --window-icon=$HOME/.icons/borg.svg --progress --pulsate --auto-close @@ -30,11 +32,8 @@ if [ -d "lock.exclusive" ]; then fi } -W="--width=600" -H="--height=500" - dossierprofil="$HOME/.config/borg/profils-borg-zenity/" -mkdir -p $dossierprofil && cd $dossierprofil +mkdir -p "$dossierprofil" && cd "$dossierprofil" # Affichage du menu ########################################################### @@ -54,7 +53,7 @@ ap\nAfficher les profils\ if [ "$choixmenu" = "cp" ];then borg_repo=$(zenity --file-selection --directory) -if [ ! -z "$(ls -A $borg_repo)" ]; then +if [ ! -z "$(ls -A "$borg_repo")" ]; then zenity $W --error --text="Erreur, le dossier n'est pas vide." exit fi @@ -67,12 +66,12 @@ if [ "$?" = "0" ];then Veuillez à sauvegarder ce dossier dans un endroit sûr.\n\n\ Si cette clé ne peut être lue les données ne seront pas récupérables.\n\n\ Notez qu'il n'existe aucun mécanisme de récupération de clé." - borg init $borg_repo | ZenityPulsate + borg init "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt chiffré a été généré dans $borg_repo" elif [ "$?" = "1" ];then zenity $W --warning --text \ "Je comprends qu'en ne sécurisant pas mon dépôt les données qu'il contient seront librement accessible par toute personne ayant accès aux fichiers du dépôt." - borg init --encryption none $borg_repo | ZenityPulsate + borg init --encryption none "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt en clair a été généré dans $borg_repo" fi From aa650ade82f66b0033902fb260a91a2b9735751a Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 23 Jun 2022 17:56:25 +0200 Subject: [PATCH 12/53] echappement des variables --- borg-gui.sh | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 49dcd27..5df93ec 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -49,7 +49,7 @@ TestBorgRepo () { bobainfoa () { TestBorgRepo - borg info ./::$borg_repo + borg info ./::"$borg_repo" } DossierPresent () { @@ -66,9 +66,9 @@ ZenityPulsate () { BorgFilter () { if [ "$filter" = "" ];then - Borg_Archive=$(borg list --short $borg_repo | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") else - Borg_Archive=$(borg list --short $borg_repo| grep $filter | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") fi } @@ -105,7 +105,7 @@ elif [ "$borg_repo" = "" ]; then exit fi -cd $borg_repo +cd "$borg_repo" TestBorgRepo @@ -141,7 +141,7 @@ MenuCreer="cs\n[+] Créer l'archive : $(echo $borg_archive)\n" fi # afficher l'espace disque sous condition, la variable vient du fichier borg-zenity.conf -EspaceDisqueUtil=$(df -k --output=pcent $borg_repo | tail -n +2 | cut -d% -f1) +EspaceDisqueUtil=$(df -k --output=pcent "$borg_repo" | tail -n +2 | cut -d% -f1) if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then MenuEspaceDisque="ed\n/!\ Espace disque utilisé : $EspaceDisqueUtil %\n" else @@ -196,16 +196,15 @@ fi # Créer une archive TestBorgRepo + DossierPresent "$borg_repo" + DossierPresent "$borg_dir" - DossierPresent $borg_repo - DossierPresent $borg_dir - - borg list --short $borg_repo | grep $borg_archive + borg list --short "$borg_repo" | grep $borg_archive if [ "$?" = "0" ];then 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 + 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" @@ -217,8 +216,8 @@ fi # Monter une archive BorgFilter if [ ! "$Borg_Archive" = "" ];then - mkdir $HOME/$Borg_Archive - borg mount $borg_repo::$Borg_Archive $HOME/$Borg_Archive | ZenityPulsate + mkdir $HOME/"$Borg_Archive" + borg mount "$borg_repo"::"$Borg_Archive" $HOME/"$Borg_Archive" | ZenityPulsate zenity $W --info --text="La sauvegarde est disponible dans le dossier\n$HOME/$Borg_Archive" fi @@ -226,9 +225,9 @@ fi # Démonter une archive ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity $W $H $iconborg --list --title "Liste des points de montages" --column "Archive") if [ ! "$ptnmontage" = "" ];then - fusermount -u $ptnmontage | ZenityPulsate + fusermount -u "$ptnmontage" | ZenityPulsate sleep 2 | ZenityPulsate - rmdir $ptnmontage | ZenityPulsate + rmdir "$ptnmontage" | ZenityPulsate fi elif [ "$choixmenu" = "dmt" ];then @@ -246,7 +245,7 @@ fi if [ "$Borg_Archive" = "" ];then zenity $W --info --text "Aucune archive choisie, retour au menu" else - borg delete $borg_repo::$Borg_Archive | ZenityPulsate + borg delete "$borg_repo"::"$Borg_Archive" | ZenityPulsate zenity $W --info --text="Suppresion de l'archive $Borg_Archive terminée" fi @@ -254,15 +253,15 @@ fi # Supprimer des archives if [ "$filter" = "" ];then - Borg_Archive=$(borg list --short $borg_repo | sed s/^/\\n/g | zenity $H $iconborg --list --checklist --title "Listes des archives" --column "Sel" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | sed s/^/\\n/g | zenity $H $iconborg --list --checklist --title "Listes des archives" --column "Sel" --column "Archive") else - Borg_Archive=$(borg list --short $borg_repo | grep $filter | sed s/^/S\\n/g | zenity $H $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") fi if [ "$Borg_Archive" = "" ];then zenity $W --info --text "Aucune archive choisie, retour au menu" else - borg delete $borg_repo::$(echo "$Borg_Archive" | sed s/\|/\ /g) | ZenityPulsate + borg delete "$borg_repo"::$(echo "$Borg_Archive" | sed s/\|/\ /g) | ZenityPulsate zenity $W --info --text="Suppression des archives terminée.\nArchives supprimées : $(echo "$Borg_Archive" | sed s/\|/\ /g)" fi @@ -274,7 +273,7 @@ fi zenity $W --info --text "Aucune archive choisie, retour au menu" else borg_nouveaunom=$(zenity --entry --text "Nouveau nom" --entry-text="$Borg_Archive") - borg rename $borg_repo::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate + borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate fi From 612a841669cacb185ba5bb5fc3c57af7964e6423 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 23 Jun 2022 18:08:33 +0200 Subject: [PATCH 13/53] =?UTF-8?q?changement=20du=20message=20pour=20le=20c?= =?UTF-8?q?hiffrement=20du=20d=C3=A9p=C3=B4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index c20fa5e..5fe0bfd 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -52,25 +52,23 @@ ap\nAfficher les profils\ if [ "$choixmenu" = "cp" ];then -borg_repo=$(zenity --file-selection --directory) +borg_repo=$(zenity --title "Dossier du dépôt" --file-selection --directory) if [ ! -z "$(ls -A "$borg_repo")" ]; then zenity $W --error --text="Erreur, le dossier n'est pas vide." exit fi -zenity $W --question --text "Chiffrer le dépôt ? (recommandé)" +zenity $W --question --text "Chiffrer le dépôt ?\n\n\ +Si vous chiffrez le dépôt, le fichier-clé du dépôt sera stocké dans le dossier $HOME/.config/borg/keys/.\n\ +Veuillez à sauvegarder ce dossier dans un endroit sûr.\n\ +Si cette clé ne peut être lue les données ne seront pas récupérables. Notez qu'il n'existe aucun mécanisme de récupération de clé.\n\n\ +Si vous ne chiffrez pas le dépôt, les données qu'il contient seront librement accessible par toute personne ayant accès aux fichiers du dépôt. +" if [ "$?" = "0" ];then - zenity $W --warning --text \ - "Le fichier-clé du dépôt sera stocké dans le dossier $HOME/.config/borg/keys/.\n\n\ - Veuillez à sauvegarder ce dossier dans un endroit sûr.\n\n\ - Si cette clé ne peut être lue les données ne seront pas récupérables.\n\n\ - Notez qu'il n'existe aucun mécanisme de récupération de clé." borg init "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt chiffré a été généré dans $borg_repo" elif [ "$?" = "1" ];then - zenity $W --warning --text \ - "Je comprends qu'en ne sécurisant pas mon dépôt les données qu'il contient seront librement accessible par toute personne ayant accès aux fichiers du dépôt." borg init --encryption none "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt en clair a été généré dans $borg_repo" fi @@ -91,7 +89,7 @@ nomsauvegarde="$nomsauvegarde" borg_repo="$borg_repo" borg_archive="\$(date +%d_%B_%Y_%H-%M)" borg_dir="$borg_dir" -borg_excludes="--exclude=*cache*" +borg_excludes="" borg_compress="" dryrun="" EOF From 7fdbcd3e48f8dda57a9f9bfecdb0708e2e7f1d8f Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 23 Jun 2022 20:14:31 +0200 Subject: [PATCH 14/53] modification du formulaire et du message de nom de profil --- profile-manager.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index 5fe0bfd..20ede9b 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -68,22 +68,21 @@ Si vous ne chiffrez pas le dépôt, les données qu'il contient seront librement if [ "$?" = "0" ];then borg init "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt chiffré a été généré dans $borg_repo" + repo_status="chiffré" elif [ "$?" = "1" ];then borg init --encryption none "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt en clair a été généré dans $borg_repo" + repo_status="non chiffré" fi borg_dir=$(zenity --title "Dossier à sauvegarder" --file-selection --directory) -vars=$(zenity --forms \ ---add-entry "Nom de sauvegarde" \ ---add-entry "Nom de profil (pas d'espace ni caractères spéciaux)") -nomsauvegarde=$(echo $vars | cut -d\| -f1) -profilename=$(echo $vars | cut -d\| -f2) +profilename=$(zenity --entry --title "Nom de profil" --text "Nom de profil (pas d'espace ni caractères spéciaux)") +nomsauvegarde=$(echo "$profilename") +if [ "$profilename" = "" ];then zenity $W --error --text "Pas de nom de profil";exit;fi if [ "$nomsauvegarde" = "" ];then zenity $W --error --text "Pas de nom de sauvegarde";exit;fi -if [ "$profilename" = "" ];then zenity $W --error --text "Pas de nom de sauvegarde";exit;fi - + cat << EOF >> "$dossierprofil""$profilename".conf nomsauvegarde="$nomsauvegarde" borg_repo="$borg_repo" @@ -94,7 +93,7 @@ borg_compress="" dryrun="" EOF -zenity $W --info --text "Le profil $profilename a été créé." +zenity $W --info --text "Le profil «$profilename» a été créé avec ces paramètres\n\nNom de profil : $profilename\nChemin à sauvegarder : $borg_dir\nChemin du dépôt : $borg_repo\nStatut du dépôt : $repo_status" ### Ajouter un dépôt existant ### From 5054a5b4cf70808815e5e6c5e22cd735763a432a Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 23 Jun 2022 20:28:55 +0200 Subject: [PATCH 15/53] =?UTF-8?q?suppression=20des=20ic=C3=B4nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 5df93ec..2ba41c3 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -127,17 +127,17 @@ 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» if [ "$(mount | grep borgfs)" != "" ];then -MenuDemonter="dm\n[▼] Démonter une archive\ndmt\n[▼▼] Démonter toutes les archives\n" +MenuDemonter="dm\nDémonter une archive\ndmt\nDémonter toutes les archives\n" MenuSupprimer="" MenuRenommer="" MenuInfo="" MenuCreer="" else MenuDemonter="" -MenuSupprimer="ss\n[X] Supprimer une archive\nsss\n[XX] Supprimer des archives\n" -MenuRenommer="ra\n[I] Renommer une archive\n" -MenuInfo="is\n[?] Information archive\n" -MenuCreer="cs\n[+] Créer l'archive : $(echo $borg_archive)\n" +MenuSupprimer="ss\nSupprimer une archive\nsss\n[XX] Supprimer des archives\n" +MenuRenommer="ra\nRenommer une archive\n" +MenuInfo="is\nInformation archive\n" +MenuCreer="cs\nCréer l'archive : $(echo $borg_archive)\n" fi # afficher l'espace disque sous condition, la variable vient du fichier borg-zenity.conf @@ -155,25 +155,25 @@ fi if [ $menu_avance = "true" ];then choixmenu=$(echo -e "\ $(echo $MenuCreer)\ -ms\n[▲] Monter une archive\n\ +ms\nMonter une archive\n\ $(echo $MenuDemonter)\ $(echo $MenuSupprimer)\ $(echo $MenuRenommer)\ $(echo $MenuInfo)\ -fi\n[*] Filtre : "$filter"\n\ +fi\nFiltre : "$filter"\n\ --\n------------------------------------------\n\ -id\n[?] Information sur le dépôt\n\ -ap\n[?] Afficher le profil\n\ +id\nInformation sur le dépôt\n\ +ap\nAfficher le profil\n\ --\n------------------------------------------\n\ $(echo $MenuEspaceDisque)\ -qu\n[Q] QUITTER\ +qu\nQUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") else choixmenu=$(echo -e "\ $(echo $MenuCreer)\ -ms\n[▲] Monter une archive\n\ +ms\nMonter une archive\n\ $(echo $MenuDemonter)\ $(echo $MenuSupprimer)\ $(echo $MenuInfo)\ From 71d7566a13e939352fd5c993360f1cb1ccc342a2 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Fri, 24 Jun 2022 21:28:37 +0200 Subject: [PATCH 16/53] =?UTF-8?q?Suppression=20des=20ic=C3=B4nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 2ba41c3..875efca 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -134,7 +134,7 @@ MenuInfo="" MenuCreer="" else MenuDemonter="" -MenuSupprimer="ss\nSupprimer une archive\nsss\n[XX] Supprimer des archives\n" +MenuSupprimer="ss\nSupprimer une archive\nsss\nSupprimer des archives\n" MenuRenommer="ra\nRenommer une archive\n" MenuInfo="is\nInformation archive\n" MenuCreer="cs\nCréer l'archive : $(echo $borg_archive)\n" @@ -178,7 +178,7 @@ $(echo $MenuDemonter)\ $(echo $MenuSupprimer)\ $(echo $MenuInfo)\ $(echo $MenuEspaceDisque)\ -qu\n[Q] QUITTER\ +qu\nQUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") fi From be321e0ca817ef3e3ac218406278b0ec48afa4dc Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Fri, 24 Jun 2022 22:27:14 +0200 Subject: [PATCH 17/53] =?UTF-8?q?gestion=20des=20erreurs=20=C3=A0=20la=20c?= =?UTF-8?q?r=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 From bad3277f9767a5647ad6443c17e36809d25e7c86 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 25 Jun 2022 19:46:50 +0200 Subject: [PATCH 18/53] simplification du code et gestion des erreurs --- borg-gui.sh | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 64de26e..4cd7fab 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -1,14 +1,12 @@ #! /bin/bash # tests de base -which zenity -if [ "$?" != "0" ]; then +if ! which zenity ; then echo "Zenity n'est pas installé.";exit exit fi -which borg -if [ "$?" != "0" ]; then +if ! which borg ; then echo "borgbackup n'est pas installé.";exit exit fi @@ -26,22 +24,19 @@ iconborg="--window-icon=/usr/share/icons/borg.svg" ################################################################################# TestBorgRepo () { if [ ! -f "config" ]; then - TestBorgErr=1 - infoerr=$(echo "Impossible de trouver le fichier de configuration borg.") + infoerr="Impossible de trouver le fichier de configuration borg." zenity $W --error --text="$infoerr" exit fi if [ ! -d "data" ]; then - TestBorgErr=1 - infoerr=$(echo "Impossible de trouver le fichier de configuration borg.") + infoerr="Impossible de trouver le fichier de configuration borg." zenity $W --error --text="$infoerr" exit fi if [ -d "lock.exclusive" ]; then - TestBorgErr=1 - infoerr=$(echo "Le dépôt est bloqué, une opération est peut-être en cours") + infoerr="Le dépôt est verrouillé, une opération est peut-être en cours" zenity $W --error --text="$infoerr" exit fi @@ -54,7 +49,7 @@ bobainfoa () { DossierPresent () { if [ ! -d "$1" ]; then - inforerror=$(echo "Erreur, le dossier $1 est absent.") + inforerror="Erreur, le dossier $1 est absent." zenity $W --error --text="$inforerror" VarDossierPresent="false" fi @@ -76,7 +71,7 @@ BorgFilter () { # Profils et tests ################################################################################# -cd "$dossierprofil" +cd "$dossierprofil" || exit fichierprofil=$(ls -1 *.conf | cut -d. -f1 | \ zenity $W $H $iconborg --list \ --title "Liste des profils" \ @@ -85,21 +80,26 @@ zenity $W $H $iconborg --list \ ) && . "$dossierprofil"/"$fichierprofil".conf if [ "$fichierprofil" = "" ]; then - infoerr=$(echo "Aucun profil choisi.") + infoerr="Aucun profil choisi." zenity $W --error --text="$infoerr" exit elif [ "$nomsauvegarde" = "" ]; then - infoerr=$(echo "Nom de sauvegarde non défini.") + infoerr="Nom de sauvegarde non défini." zenity $W --error --text="$infoerr" exit elif [ "$borg_repo" = "" ]; then - infoerr=$(echo "Variable \$borg_repo absente") + infoerr="Variable \$borg_repo absente" zenity $W --error --text="$infoerr" exit fi -cd "$borg_repo" -TestBorgRepo + +if ! cd "$borg_repo" ;then + zenity $W --error --text="Impossible de trouver de dépôt borg." + exit +else + TestBorgRepo +fi ################################################################################# @@ -116,6 +116,7 @@ fi ################################################################################# while [ "$quitter" != "yes" ];do +cd "$borg_repo" || exit # 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» @@ -130,7 +131,7 @@ MenuDemonter="" MenuSupprimer="ss\nSupprimer une archive\nsss\nSupprimer des archives\n" MenuRenommer="ra\nRenommer une archive\n" MenuInfo="is\nInformation archive\n" -MenuCreer="cs\nCréer l'archive : $(echo $borg_archive)\n" +MenuCreer="cs\nCréer l'archive : $borg_archive\n" fi # afficher l'espace disque sous condition, la variable vient du fichier borg-zenity.conf @@ -190,18 +191,16 @@ fi TestBorgRepo DossierPresent "$borg_repo" - DossierPresent "$borg_dir" + DossierPresent "$borg_dir" && cd "$borg_dir" - borg list --short "$borg_repo" | grep $borg_archive - if [ "$?" = "0" ];then + if borg list --short "$borg_repo" | grep $borg_archive ;then zenity --warning $W $iconborg --text "L'archive existe déjà." else if [ "$VarDossierPresent" != "false" ];then - cd "$borg_dir" - log="$HOME/borg-zenity-$borg_archive.log" - borg create $borg_excludes $borg_compress "$borg_repo"::"$borg_archive" ./ 2>> "$log" | ZenityPulsate + log="/tmp/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 + if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" else sync | ZenityPulsate From 6e9ec568aee91ce5c0fe28fbfe0afb4bfcbb7411 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 25 Jun 2022 19:59:25 +0200 Subject: [PATCH 19/53] =?UTF-8?q?ajout=20des=20ic=C3=B4nes=20sur=20les=20n?= =?UTF-8?q?otifications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 4cd7fab..10c42fa 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -204,7 +204,7 @@ fi zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" else sync | ZenityPulsate - zenity --notification --text "Sauvegarde $nomsauvegarde terminée" + zenity $iconborg --notification --text "Sauvegarde $nomsauvegarde terminée" zenity $W --info --text "Sauvegarde $nomsauvegarde terminée" fi fi @@ -233,7 +233,7 @@ fi # Démonter toutes les archives while [ $(mount | grep borgfs | cut -d" " -f3 | head -n 1) ];do ptnmontage="$(mount | grep borgfs | cut -d" " -f3 | head -n 1)" - notify-send -i $iconborg "borg-zenity" "Démontage de $ptnmontage" + zenity --notification $iconborg --text="Démontage de $ptnmontage" fusermount -uz $ptnmontage && sleep 2 && rmdir $ptnmontage done From 3ac6e8b4385298954d2c82c50ed29b3547c84667 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Tue, 28 Jun 2022 18:11:49 +0200 Subject: [PATCH 20/53] =?UTF-8?q?si=20le=20fichier=20de=20configuration=20?= =?UTF-8?q?existe,=20ne=20pas=20=C3=A9craser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install.sh b/install.sh index 96ff508..fe75e41 100644 --- a/install.sh +++ b/install.sh @@ -58,7 +58,9 @@ fi # Création du fichier de configuration de base mkdir -vp $HOME/.config/borg/ +if [ ! -f $HOME/.config/borg/borg-zenity.conf ];then cp -fv borg-zenity.conf $HOME/.config/borg/ +fi # nettoyage if [ -f readme.md ];then cd ..;fi From 145894091a1f2ceeb1866c02a14bf1f21929e6cf Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Mon, 4 Jul 2022 11:01:05 +0200 Subject: [PATCH 21/53] =?UTF-8?q?correction=20d'une=20typo=20sur=20le=20cr?= =?UTF-8?q?=C3=A9ation=20du=20d=C3=A9p=C3=B4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index 20ede9b..f2e0023 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -6,7 +6,7 @@ W="--width=600" H="--height=500" ZenityPulsate () { -zenity $W --window-icon=$HOME/.icons/borg.svg --progress --pulsate --auto-close +zenity $W --window-icon=borg --progress --pulsate --auto-close } TestBorgRepo () { @@ -66,17 +66,16 @@ Si vous ne chiffrez pas le dépôt, les données qu'il contient seront librement " if [ "$?" = "0" ];then - borg init "$borg_repo" | ZenityPulsate + borg init --encryption=keyfile "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt chiffré a été généré dans $borg_repo" repo_status="chiffré" elif [ "$?" = "1" ];then - borg init --encryption none "$borg_repo" | ZenityPulsate + borg init --encryption=none "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt en clair a été généré dans $borg_repo" repo_status="non chiffré" fi borg_dir=$(zenity --title "Dossier à sauvegarder" --file-selection --directory) - profilename=$(zenity --entry --title "Nom de profil" --text "Nom de profil (pas d'espace ni caractères spéciaux)") nomsauvegarde=$(echo "$profilename") From 43798a051eb2a63767175b3c4002daefda9afc17 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Mon, 4 Jul 2022 19:40:14 +0200 Subject: [PATCH 22/53] =?UTF-8?q?correction=20de=20l'erreur=20de=20cr?= =?UTF-8?q?=C3=A9ation=20de=20d=C3=A9p=C3=B4t=20chiffr=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/profile-manager.sh b/profile-manager.sh index f2e0023..e315317 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -66,6 +66,7 @@ Si vous ne chiffrez pas le dépôt, les données qu'il contient seront librement " if [ "$?" = "0" ];then + export BORG_PASSPHRASE="" borg init --encryption=keyfile "$borg_repo" | ZenityPulsate zenity $W --info --text "Un nouveau dépôt chiffré a été généré dans $borg_repo" repo_status="chiffré" From 298fd090ace60dc5d43a440c2f53464bd8689be8 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Tue, 12 Jul 2022 21:36:11 +0200 Subject: [PATCH 23/53] =?UTF-8?q?simplification=20de=20TestBorgRepo=20cont?= =?UTF-8?q?r=C3=B4le=20lors=20de=20l'ajout=20d'un=20d=C3=A9p=C3=B4t=20exis?= =?UTF-8?q?tant=20simplification=20du=20formulaire=20ajout=20d=C3=A9p?= =?UTF-8?q?=C3=B4t=20existant=20supression=20chemin=20ic=C3=B4nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 61 ++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index e315317..5626124 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -11,39 +11,31 @@ zenity $W --window-icon=borg --progress --pulsate --auto-close TestBorgRepo () { if [ ! -f "config" ]; then - TestBorgErr=1 - infoerr=$(echo "Impossible de trouver le fichier de configuration du dépôt.") - zenity $W --error --text="$infoerr" - exit + zenity $W --error --text="Impossible de trouver le fichier de configuration du dépôt." + TestBorgErr="true" +else + TestBorgErr="false" fi if [ ! -d "data" ]; then - TestBorgErr=1 - infoerr=$(echo "Impossible de trouver le dossier des données du dépôt.") - zenity $W --error --text="$infoerr" - exit -fi - -if [ -d "lock.exclusive" ]; then - TestBorgErr=1 - infoerr=$(echo "Le dépôt est bloqué, une opération est peut-être en cours") - zenity $W --error --text="$infoerr" - exit + zenity $W --error --text="Impossible de trouver le dossier des données du dépôt." + TestBorgErr="true" +else + TestBorgErr="false" fi } dossierprofil="$HOME/.config/borg/profils-borg-zenity/" -mkdir -p "$dossierprofil" && cd "$dossierprofil" +mkdir -p "$dossierprofil" && cd "$dossierprofil" || exit # Affichage du menu ########################################################### choixmenu=$(echo -e "\ cp\nCréer un nouveau profil/dépôt\n\ -ajd\nAjouter un dépôt existant\n\ +ajd\nCréer un nouveau profil et le lier à un dépôt existant\n\ ap\nAfficher les profils\ -" | zenity $H $W --window-icon=$HOME/.icons/borg.svg --list \ ---column "id" --column "choix") +" | zenity $H $W --window-icon=borg --list --column "id" --column "choix" --hide-column=1 --hide-header) # Gestion des choix du menu ########################################################### @@ -93,21 +85,32 @@ borg_compress="" dryrun="" EOF -zenity $W --info --text "Le profil «$profilename» a été créé avec ces paramètres\n\nNom de profil : $profilename\nChemin à sauvegarder : $borg_dir\nChemin du dépôt : $borg_repo\nStatut du dépôt : $repo_status" +zenity $W --info --text "\ +Le profil «$profilename» a été créé avec ces paramètres\n\n\ +Nom de profil : $profilename\n\ +Chemin à sauvegarder : $borg_dir\n\ +Chemin du dépôt : $borg_repo\n\ +Statut du dépôt : $repo_status" ### Ajouter un dépôt existant ### elif [ "$choixmenu" = "ajd" ];then -borg_repo=$(zenity --title "Dossier du dépôt" --file-selection --directory) -borg_dir=$(zenity --title "Dossier à sauvegarder" --file-selection --directory) +TestBorgErr="true" +while [ "$TestBorgErr" = "true" ];do +echo "-> while" +borg_repo_test=$(zenity --title "Dossier du dépôt" --file-selection --directory) +if [ $? = "1" ];then exit;fi +cd "$borg_repo_test" && TestBorgRepo +echo "TestBorgErr : $TestBorgErr" +if [ "$TestBorgErr" = "false" ];then borg_repo=$borg_repo_test;fi +echo "borg_repo = $borg_repo" +echo "borg_repo_test = $borg_repo_test" +done -vars=$(zenity --forms \ ---text "Laisser les champs vides pour les options par défaut" \ ---add-entry "Nom de sauvegarde" \ ---add-entry "Nom de profil (pas d'espace ni caractères spéciaux)") -nomsauvegarde=$(echo $vars | cut -d\| -f1) -profilename=$(echo $vars | cut -d\| -f2) +borg_dir=$(zenity --title "Dossier à sauvegarder" --file-selection --directory) +profilename=$(zenity --entry --title "Nom de profil" --text "Nom de profil (pas d'espace ni caractères spéciaux)") +nomsauvegarde=$(echo "$profilename") cat << EOF >> "$dossierprofil""$profilename".conf nomsauvegarde="$nomsauvegarde" @@ -124,7 +127,7 @@ zenity $W --info --text "Le dépôt à bien été ajouté.\nLancez «Borg Zenity ### Afficher les profils ### elif [ "$choixmenu" = "ap" ];then -fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=$HOME/.icons/borg.svg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") +fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=borg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") zenity $W $H --info --text="$(cd "$dossierprofil" && cat "$fichierprofil")" elif [ "$choixmenu" = "" ];then From c15911e9d2f474810d6005b1704c10c81695b437 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Tue, 12 Jul 2022 21:43:17 +0200 Subject: [PATCH 24/53] =?UTF-8?q?correction=20des=20largeur=20de=20fen?= =?UTF-8?q?=C3=AAtres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 10c42fa..f839497 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -61,9 +61,9 @@ ZenityPulsate () { BorgFilter () { if [ "$filter" = "" ];then - Borg_Archive=$(borg list --short "$borg_repo" | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") else - Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | zenity $H $iconborg --list --title "Listes des archives" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") fi } @@ -252,9 +252,9 @@ fi # Supprimer des archives if [ "$filter" = "" ];then - Borg_Archive=$(borg list --short "$borg_repo" | sed s/^/\\n/g | zenity $H $iconborg --list --checklist --title "Listes des archives" --column "Sel" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | sed s/^/\\n/g | zenity $H $W $iconborg --list --checklist --title "Listes des archives" --column "Sel" --column "Archive") else - Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") + Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $W $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") fi if [ "$Borg_Archive" = "" ];then From 2b35ce5797b9f3be516b6ee3b82161162828424d Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Tue, 12 Jul 2022 21:45:33 +0200 Subject: [PATCH 25/53] =?UTF-8?q?suppression=20du=20message=20vide=20si=20?= =?UTF-8?q?on=20quitte=20sans=20s=C3=A9l=C3=A9ctionner=20de=20profil=20dan?= =?UTF-8?q?s=20=C2=ABafficher=20profil=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profile-manager.sh b/profile-manager.sh index 5626124..a67eb24 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -128,7 +128,9 @@ zenity $W --info --text "Le dépôt à bien été ajouté.\nLancez «Borg Zenity elif [ "$choixmenu" = "ap" ];then fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=borg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") +if [ "$fichierprofil" != "" ];then zenity $W $H --info --text="$(cd "$dossierprofil" && cat "$fichierprofil")" +fi elif [ "$choixmenu" = "" ];then exit From ef5e46fa3a4d31645de7e8a8eab0eec93fd8c4bf Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 14 Jul 2022 15:05:52 +0200 Subject: [PATCH 26/53] =?UTF-8?q?ajout=20du=20menu=20=C2=ABModifier=20un?= =?UTF-8?q?=20profil=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/profile-manager.sh b/profile-manager.sh index a67eb24..52deb6e 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -34,7 +34,8 @@ mkdir -p "$dossierprofil" && cd "$dossierprofil" || exit choixmenu=$(echo -e "\ cp\nCréer un nouveau profil/dépôt\n\ ajd\nCréer un nouveau profil et le lier à un dépôt existant\n\ -ap\nAfficher les profils\ +ap\nAfficher les profils\n\ +mp\nModifier un profil (connaissance en ligne de commande borg requise)\ " | zenity $H $W --window-icon=borg --list --column "id" --column "choix" --hide-column=1 --hide-header) # Gestion des choix du menu @@ -132,6 +133,11 @@ if [ "$fichierprofil" != "" ];then zenity $W $H --info --text="$(cd "$dossierprofil" && cat "$fichierprofil")" fi +elif [ "$choixmenu" = "mp" ];then +fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=borg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") +zenity $W $H --text-info --editable --title="profil $fichierprofil" --filename "$fichierprofil" > "$dossierprofil"/"$fichierprofil".tmp +mv "$dossierprofil"/"$fichierprofil".tmp "$dossierprofil"/"$fichierprofil" + elif [ "$choixmenu" = "" ];then exit fi From f9c05fcb12f971301caa0d3b3e11ff16cf1fc610 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 14 Jul 2022 15:06:26 +0200 Subject: [PATCH 27/53] supression du debug dans le while --- profile-manager.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index 52deb6e..d38a3d9 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -99,14 +99,10 @@ elif [ "$choixmenu" = "ajd" ];then TestBorgErr="true" while [ "$TestBorgErr" = "true" ];do -echo "-> while" borg_repo_test=$(zenity --title "Dossier du dépôt" --file-selection --directory) if [ $? = "1" ];then exit;fi cd "$borg_repo_test" && TestBorgRepo -echo "TestBorgErr : $TestBorgErr" if [ "$TestBorgErr" = "false" ];then borg_repo=$borg_repo_test;fi -echo "borg_repo = $borg_repo" -echo "borg_repo_test = $borg_repo_test" done borg_dir=$(zenity --title "Dossier à sauvegarder" --file-selection --directory) From 9422c4412bc13e3a959c6160d08d82957f071fcd Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 14 Jul 2022 15:08:06 +0200 Subject: [PATCH 28/53] typo dans la ligne de commande --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 14374bd..4784eb3 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,7 @@ S'il n'y parvient pas vous devrez les installer manuellement. Avant tout sachez que la version dans la branche `dev` est encore en test. L'installation devrait pouvoir se faire en une ligne de commande. Copiez ceci dans votre terminal. ``` -wget -O borg-zenity.zip https://git.djan-gicquel.fr/djan/borg-zenity/archive/dev.zip && unzip -d borg-zenity borg-zenity.zip && cd borg-zenity && bash install.sh +wget -O borg-zenity.zip https://git.djan-gicquel.fr/djan/borg-zenity/archive/dev.zip && unzip -d ./ borg-zenity.zip && cd borg-zenity && bash install.sh ``` Cette commande va télécharger les fichiers d'installation et exécuter le script d'installation. From a34789851f77a12eaca41e2240e82b819ef6b520 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 17 Jul 2022 03:05:51 +0200 Subject: [PATCH 29/53] correction largeur des boite de dialogue de saisie (renommer et filtre) --- borg-gui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index f839497..fd2ced7 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -271,7 +271,7 @@ fi if [ "$Borg_Archive" = "" ];then zenity $W --info --text "Aucune archive choisie, retour au menu" else - borg_nouveaunom=$(zenity --entry --text "Nouveau nom" --entry-text="$Borg_Archive") + borg_nouveaunom=$(zenity $W --entry --text "Nouveau nom" --entry-text="$Borg_Archive") borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate fi @@ -287,7 +287,7 @@ fi elif [ "$choixmenu" = "fi" ];then #Filtre - filter=$(zenity --entry) + filter=$(zenity $W --entry) elif [ "$choixmenu" = "id" ];then # Information sur le dépôt From 7a8ba976783fd0d7f06e88fbfd2f8b6b52d1258a Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 21 Jul 2022 21:09:52 +0200 Subject: [PATCH 30/53] prise en charge de l'annulation lors de la modification de profil --- profile-manager.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index d38a3d9..0210a78 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -129,10 +129,18 @@ if [ "$fichierprofil" != "" ];then zenity $W $H --info --text="$(cd "$dossierprofil" && cat "$fichierprofil")" fi +### Modifier un profil ### elif [ "$choixmenu" = "mp" ];then fichierprofil=$(ls -1 *.conf | zenity $H $W --window-icon=borg --list --title "Liste des profils" --text "Choisir un profil dans la liste" --hide-header --column "profil") -zenity $W $H --text-info --editable --title="profil $fichierprofil" --filename "$fichierprofil" > "$dossierprofil"/"$fichierprofil".tmp -mv "$dossierprofil"/"$fichierprofil".tmp "$dossierprofil"/"$fichierprofil" +cp "$fichierprofil" "$fichierprofil.tmp" +return=$(zenity $W $H --text-info --editable --title="profil $fichierprofil" --filename "$fichierprofil.tmp") +if [ "$return" = "" ];then + rm "$fichierprofil.tmp" + exit +else + echo "$return" > "$fichierprofil.tmp" + mv "$fichierprofil.tmp" "$fichierprofil" +fi elif [ "$choixmenu" = "" ];then exit From aedbadd83428b1f9d6b6bc5d9d217405f1c98c09 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 21 Jul 2022 21:22:04 +0200 Subject: [PATCH 31/53] =?UTF-8?q?=C3=A9chappement=20des=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index fd2ced7..6b8769d 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -193,12 +193,12 @@ fi DossierPresent "$borg_repo" DossierPresent "$borg_dir" && cd "$borg_dir" - if borg list --short "$borg_repo" | grep $borg_archive ;then + if borg list --short "$borg_repo" | grep "$borg_archive" ;then zenity --warning $W $iconborg --text "L'archive existe déjà." else if [ "$VarDossierPresent" != "false" ];then log="/tmp/borg-zenity-$borg_archive.log" - borg create $borg_excludes $borg_compress "$borg_repo"::"$borg_archive" ./ 2> "$log" | ZenityPulsate + borg create "$borg_excludes" "$borg_compress" "$borg_repo"::"$borg_archive" ./ 2>> "$log" | ZenityPulsate chmod 777 "$log" if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" @@ -234,7 +234,7 @@ fi while [ $(mount | grep borgfs | cut -d" " -f3 | head -n 1) ];do ptnmontage="$(mount | grep borgfs | cut -d" " -f3 | head -n 1)" zenity --notification $iconborg --text="Démontage de $ptnmontage" - fusermount -uz $ptnmontage && sleep 2 && rmdir $ptnmontage + fusermount -uz "$ptnmontage" && sleep 2 && rmdir "$ptnmontage" done @@ -282,7 +282,7 @@ fi if [ "$Borg_Archive" = "" ];then zenity $W --info --text "Aucune archive choisie, retour au menu" else - zenity $W --info --text="$(borg info $borg_repo::$Borg_Archive)" | ZenityPulsate + zenity $W --info --text="$(borg info "$borg_repo"::"$Borg_Archive")" | ZenityPulsate fi elif [ "$choixmenu" = "fi" ];then @@ -291,7 +291,7 @@ fi elif [ "$choixmenu" = "id" ];then # Information sur le dépôt - zenity $W --info --text="$(borg info $borg_repo)" | ZenityPulsate + zenity $W --info --text="$(borg info "$borg_repo")" | ZenityPulsate elif [ "$choixmenu" = "ap" ];then # Afficher le profil @@ -304,6 +304,5 @@ fi else zenity $W --warning --text="Une ou des archives sont montées.\nDémontez-le afin de laisser le dépôt dans un état cohérent." fi - fi done From bc4b3e7df339dfa39e2ac651bb7defada2269856 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 21 Jul 2022 21:41:04 +0200 Subject: [PATCH 32/53] =?UTF-8?q?changement=20du=20test=20dossier=20pr?= =?UTF-8?q?=C3=A9sent=20=C3=A9chappement=20des=20variables=20$borg=5Fexclu?= =?UTF-8?q?des=20et=20$borg=5Fcompress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 6b8769d..3b505a9 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -191,14 +191,20 @@ fi TestBorgRepo DossierPresent "$borg_repo" - DossierPresent "$borg_dir" && cd "$borg_dir" + DossierPresent "$borg_dir" + cd "$borg_dir" + if [ ! "$?" = "0" ] ;then + zenity $W --error --text "Impossible de se rendre dans le dossier de sauvegarde." + exit + fi + touch test if borg list --short "$borg_repo" | grep "$borg_archive" ;then zenity --warning $W $iconborg --text "L'archive existe déjà." else if [ "$VarDossierPresent" != "false" ];then log="/tmp/borg-zenity-$borg_archive.log" - borg create "$borg_excludes" "$borg_compress" "$borg_repo"::"$borg_archive" ./ 2>> "$log" | ZenityPulsate + borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" "." >> "$log" | ZenityPulsate chmod 777 "$log" if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" From 955e74f069342ca3aae9b9d36f23bf61f7ac41bf Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 21 Jul 2022 21:42:50 +0200 Subject: [PATCH 33/53] =?UTF-8?q?changement=20de=20titre=20de=20la=20fen?= =?UTF-8?q?=C3=AAtre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 3b505a9..1653d8f 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -161,7 +161,7 @@ ap\nAfficher le profil\n\ --\n------------------------------------------\n\ $(echo $MenuEspaceDisque)\ qu\nQUITTER\ -" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ +" | zenity $iconborg --list $H $W --title "$nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") else @@ -197,7 +197,6 @@ fi zenity $W --error --text "Impossible de se rendre dans le dossier de sauvegarde." exit fi - touch test if borg list --short "$borg_repo" | grep "$borg_archive" ;then zenity --warning $W $iconborg --text "L'archive existe déjà." From 5619b57f0f7c56381150db852be0c95ee564189f Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 23 Jul 2022 12:31:25 +0200 Subject: [PATCH 34/53] =?UTF-8?q?simplification=20des=20if=20supression=20?= =?UTF-8?q?des=20dialogues=20=C2=ABAucune=20archive=20choisie,=20retour=20?= =?UTF-8?q?au=20menu=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 1653d8f..c516ca9 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -246,9 +246,7 @@ fi elif [ "$choixmenu" = "ss" ];then # Supprimer une archive BorgFilter - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then borg delete "$borg_repo"::"$Borg_Archive" | ZenityPulsate zenity $W --info --text="Suppresion de l'archive $Borg_Archive terminée" fi @@ -262,9 +260,7 @@ fi Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | sed s/^/S\\n/g | zenity $H $W $iconborg --list --checklist --title "Listes des archives" --column "S" --column "Archive") fi - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then borg delete "$borg_repo"::$(echo "$Borg_Archive" | sed s/\|/\ /g) | ZenityPulsate zenity $W --info --text="Suppression des archives terminée.\nArchives supprimées : $(echo "$Borg_Archive" | sed s/\|/\ /g)" fi @@ -273,9 +269,7 @@ fi # renommer une archive BorgFilter - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then borg_nouveaunom=$(zenity $W --entry --text "Nouveau nom" --entry-text="$Borg_Archive") borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate fi @@ -284,9 +278,7 @@ fi elif [ "$choixmenu" = "is" ];then # Information archive BorgFilter - if [ "$Borg_Archive" = "" ];then - zenity $W --info --text "Aucune archive choisie, retour au menu" - else + if [ ! "$Borg_Archive" = "" ];then zenity $W --info --text="$(borg info "$borg_repo"::"$Borg_Archive")" | ZenityPulsate fi From 036b7c953a7af1e5146cdae86625e890e01dd04b Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 23 Jul 2022 12:48:38 +0200 Subject: [PATCH 35/53] correction fonction filter, la liste est construite avant l'affichage --- borg-gui.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index c516ca9..5029628 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -61,9 +61,11 @@ ZenityPulsate () { BorgFilter () { if [ "$filter" = "" ];then - Borg_Archive=$(borg list --short "$borg_repo" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") + BorgArchiveList=$(borg list --short "$borg_repo") + Borg_Archive=$(echo -e "$BorgArchiveList" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") else - Borg_Archive=$(borg list --short "$borg_repo" | grep "$filter" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") + BorgArchiveList=$(borg list --short "$borg_repo") + Borg_Archive=$(echo -e "$BorgArchiveList" | grep "$filter" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") fi } From 8cb2fc93f17e00609dbaeb4a58eef8b4a7f45c17 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 23 Jul 2022 12:52:41 +0200 Subject: [PATCH 36/53] correction de l'option filtre --- borg-gui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borg-gui.sh b/borg-gui.sh index 5029628..94632a8 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -286,7 +286,7 @@ fi elif [ "$choixmenu" = "fi" ];then #Filtre - filter=$(zenity $W --entry) + filter=$(zenity $W --entry --entry-text "$filter") elif [ "$choixmenu" = "id" ];then # Information sur le dépôt From 04136dc7efe7f9704fff09f8c8eeff1215620738 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 23 Jul 2022 20:18:48 +0200 Subject: [PATCH 37/53] =?UTF-8?q?correction=20d'une=20regression=20sur=20l?= =?UTF-8?q?a=20cr=C3=A9ation=20d'archive=20:=20retour=20de=20la=20barre=20?= =?UTF-8?q?de=20progression=20affichage=20inconditionnel=20de=20la=20boite?= =?UTF-8?q?=20de=20dialogue=20sauvegarde=20termin=C3=A9e=20affichage=20du?= =?UTF-8?q?=20log=20si=20erreur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 94632a8..863b441 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -204,16 +204,15 @@ fi zenity --warning $W $iconborg --text "L'archive existe déjà." else if [ "$VarDossierPresent" != "false" ];then - log="/tmp/borg-zenity-$borg_archive.log" - borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" "." >> "$log" | ZenityPulsate + log="/tmp/borg-zenity-$borg_archive-$(date +%H-%M-%S).log" + borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" . 2> "$log" | ZenityPulsate chmod 777 "$log" if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" - else + fi sync | ZenityPulsate zenity $iconborg --notification --text "Sauvegarde $nomsauvegarde terminée" zenity $W --info --text "Sauvegarde $nomsauvegarde terminée" - fi fi fi From f7d107eb961d9f15cb532d010bae6863608af2ec Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Wed, 10 Aug 2022 08:23:30 +0200 Subject: [PATCH 38/53] renommer : notification + gestion annulation --- borg-gui.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 863b441..1b1ecbc 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -234,6 +234,7 @@ fi sleep 2 | ZenityPulsate rmdir "$ptnmontage" | ZenityPulsate fi + zenity --notification $iconborg --text="Démontage de $ptnmontage" elif [ "$choixmenu" = "dmt" ];then # Démonter toutes les archives @@ -271,10 +272,16 @@ fi BorgFilter if [ ! "$Borg_Archive" = "" ];then - borg_nouveaunom=$(zenity $W --entry --text "Nouveau nom" --entry-text="$Borg_Archive") - borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate + borg_nouveaunom=$(zenity $W --entry --text "Nouveau nom" --entry-text="$Borg_Archive") + if [ "$borg_nouveaunom" = "$Borg_Archive" ];then + zenity --notification $iconborg --text="Renommage annulé" + elif [ "$borg_nouveaunom" = "" ];then + zenity --notification $iconborg --text="Renommage annulé" + elif [ "$Borg_Archive" != "$borg_nouveaunom" ];then + borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate + zenity --notification $iconborg --text="Renommage terminé\n"$Borg_Archive" -> "$borg_nouveaunom"" + fi fi - elif [ "$choixmenu" = "is" ];then # Information archive From 719cb63aef86414835779eab484639326989a61b Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Wed, 10 Aug 2022 08:25:13 +0200 Subject: [PATCH 39/53] suppression fonction bobainfoa --- borg-gui.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 1b1ecbc..4cc39d3 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -42,11 +42,6 @@ TestBorgRepo () { fi } -bobainfoa () { - TestBorgRepo - borg info ./::"$borg_repo" -} - DossierPresent () { if [ ! -d "$1" ]; then inforerror="Erreur, le dossier $1 est absent." From 8aed42b296479fc43e2f7c52ba013dd638f0ab6f Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 11 Aug 2022 18:07:41 +0200 Subject: [PATCH 40/53] notification espace disque faible --- borg-gui.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/borg-gui.sh b/borg-gui.sh index 4cc39d3..f942e9b 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -144,6 +144,13 @@ fi ################################################################################# if [ $menu_avance = "true" ];then + +# notification si espace disque faible +if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then +zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible" +fi + +# menu avancé choixmenu=$(echo -e "\ $(echo $MenuCreer)\ ms\nMonter une archive\n\ @@ -162,6 +169,12 @@ qu\nQUITTER\ --hide-header --hide-column=1 --column "id" --column "choix") else +# notification si espace disque faible +if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then +zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible" +fi + +# menu simple choixmenu=$(echo -e "\ $(echo $MenuCreer)\ ms\nMonter une archive\n\ From e9c0cf4c616ff855fb34bf0b3de45feae0a4961d Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Fri, 12 Aug 2022 12:03:23 +0200 Subject: [PATCH 41/53] =?UTF-8?q?ajout=20de=20no-cancel=20=C3=A0=20la=20cr?= =?UTF-8?q?=C3=A9ation=20d'archive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit en attente de trouver une solution perenne pour l'annulation --- borg-gui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borg-gui.sh b/borg-gui.sh index f942e9b..6d617e1 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -213,7 +213,7 @@ fi else if [ "$VarDossierPresent" != "false" ];then log="/tmp/borg-zenity-$borg_archive-$(date +%H-%M-%S).log" - borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" . 2> "$log" | ZenityPulsate + borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" . 2> "$log" | zenity $W $iconborg --progress --pulsate --auto-close --no-cancel chmod 777 "$log" if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" From bca79eba956827b6fe255ea316744c90d5f58a79 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Tue, 11 Oct 2022 18:30:02 +0200 Subject: [PATCH 42/53] =?UTF-8?q?ajout=20de=20l'option=20=C2=ABcompactage?= =?UTF-8?q?=20du=20d=C3=A9p=C3=B4t=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/borg-gui.sh b/borg-gui.sh index 6d617e1..f687a4c 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -139,6 +139,8 @@ else MenuEspaceDisque="" fi +MenuCompacter="co\nCompacter le dépôt\n" + ################################################################################# # Affichage du menu ################################################################################# @@ -157,6 +159,7 @@ ms\nMonter une archive\n\ $(echo $MenuDemonter)\ $(echo $MenuSupprimer)\ $(echo $MenuRenommer)\ +$(echo $MenuCompacter)\ $(echo $MenuInfo)\ fi\nFiltre : "$filter"\n\ --\n------------------------------------------\n\ @@ -275,6 +278,11 @@ fi zenity $W --info --text="Suppression des archives terminée.\nArchives supprimées : $(echo "$Borg_Archive" | sed s/\|/\ /g)" fi + elif [ "$choixmenu" = "co" ];then + # Compacter le dépôt + borg compact --verbose "$borg_repo" 2> /tmp/borg-compact.log | ZenityPulsate + zenity $W --info --text "$(cat /tmp/borg-compact.log)" + elif [ "$choixmenu" = "ra" ];then # renommer une archive BorgFilter From d19d5277ec0aedefa6330d8f9903cf4efcafd382 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 13 Oct 2022 17:51:59 +0200 Subject: [PATCH 43/53] suppression option menu simple (suppr des archives, info archive) --- borg-gui.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index f687a4c..9056cc2 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -125,7 +125,8 @@ MenuInfo="" MenuCreer="" else MenuDemonter="" -MenuSupprimer="ss\nSupprimer une archive\nsss\nSupprimer des archives\n" +MenuSupprimer1="ss\nSupprimer une archive\n" +MenuSupprimerX="sss\nSupprimer des archives\n" MenuRenommer="ra\nRenommer une archive\n" MenuInfo="is\nInformation archive\n" MenuCreer="cs\nCréer l'archive : $borg_archive\n" @@ -157,7 +158,8 @@ choixmenu=$(echo -e "\ $(echo $MenuCreer)\ ms\nMonter une archive\n\ $(echo $MenuDemonter)\ -$(echo $MenuSupprimer)\ +$(echo $MenuSupprimer1)\ +$(echo $MenuSupprimerX)\ $(echo $MenuRenommer)\ $(echo $MenuCompacter)\ $(echo $MenuInfo)\ @@ -182,8 +184,7 @@ choixmenu=$(echo -e "\ $(echo $MenuCreer)\ ms\nMonter une archive\n\ $(echo $MenuDemonter)\ -$(echo $MenuSupprimer)\ -$(echo $MenuInfo)\ +$(echo $MenuSupprimer1)\ $(echo $MenuEspaceDisque)\ qu\nQUITTER\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ From 53b69c67fb2a5475d2291c3fdcb038eb6913b47d Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 13 Oct 2022 18:00:50 +0200 Subject: [PATCH 44/53] factorisation du menu --- borg-gui.sh | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index 9056cc2..ad0abe9 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -140,7 +140,20 @@ else MenuEspaceDisque="" fi +# notification si espace disque faible +NotificationEspaceDisque () { + if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then + zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible" + fi +} + MenuCompacter="co\nCompacter le dépôt\n" +MenuMonter="ms\nMonter une archive\n" +MenuFiltre="fi\nFiltre : "$filter"\n" +MenuBarreHorizontale="--\n------------------------------------------\n" +MenuInfoDepot="id\nInformation sur le dépôt\n" +MenuAfficherProfil="ap\nAfficher le profil\n" +MenuQuitter="qu\nQUITTER\n" ################################################################################# # Affichage du menu @@ -148,45 +161,39 @@ MenuCompacter="co\nCompacter le dépôt\n" if [ $menu_avance = "true" ];then -# notification si espace disque faible -if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then -zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible" -fi +NotificationEspaceDisque # menu avancé choixmenu=$(echo -e "\ $(echo $MenuCreer)\ -ms\nMonter une archive\n\ +$(echo $MenuMonter)\ $(echo $MenuDemonter)\ $(echo $MenuSupprimer1)\ $(echo $MenuSupprimerX)\ $(echo $MenuRenommer)\ $(echo $MenuCompacter)\ $(echo $MenuInfo)\ -fi\nFiltre : "$filter"\n\ ---\n------------------------------------------\n\ -id\nInformation sur le dépôt\n\ -ap\nAfficher le profil\n\ ---\n------------------------------------------\n\ +$(echo $MenuFiltre)\ +$(echo $MenuBarreHorizontale)\ +$(echo $MenuInfoDepot)\ +$(echo $MenuAfficherProfil)\ +$(echo $MenuBarreHorizontale)\ $(echo $MenuEspaceDisque)\ -qu\nQUITTER\ +$(echo $MenuQuitter)\ " | zenity $iconborg --list $H $W --title "$nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") else -# notification si espace disque faible -if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then -zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible" -fi +NotificationEspaceDisque # menu simple choixmenu=$(echo -e "\ $(echo $MenuCreer)\ -ms\nMonter une archive\n\ +$(echo $MenuMonter)\ $(echo $MenuDemonter)\ $(echo $MenuSupprimer1)\ $(echo $MenuEspaceDisque)\ -qu\nQUITTER\ +$(echo $MenuQuitter)\ " | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ --hide-header --hide-column=1 --column "id" --column "choix") fi From 76a4b067276feb0345f4ad5cc3b9d24e3cbc6eb5 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Thu, 13 Oct 2022 18:02:49 +0200 Subject: [PATCH 45/53] =?UTF-8?q?ajout=20de=20l'espace=20disque=20utilis?= =?UTF-8?q?=C3=A9=20dans=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borg-gui.sh b/borg-gui.sh index ad0abe9..a35b75c 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -143,7 +143,7 @@ fi # notification si espace disque faible NotificationEspaceDisque () { if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then - zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible" + zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible, $EspaceDisqueUtil% occupé" fi } From 84c8a9f1c710ebd545535796df05124acbff83af Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 29 Oct 2022 13:24:01 +0200 Subject: [PATCH 46/53] =?UTF-8?q?cd=20dans=20home=20avant=20de=20cr=C3=A9e?= =?UTF-8?q?r=20le=20d=C3=A9p=C3=B4t=20ajout=20d'un=20while=20pour=20g?= =?UTF-8?q?=C3=A9rer=20le=20dossier=20du=20d=C3=A9p=C3=B4t=20ajout=20d'exp?= =?UTF-8?q?lications=20pour=20le=20dossier=20du=20d=C3=A9p=C3=B4t=20et=20l?= =?UTF-8?q?e=20dossier=20=C3=A0=20sauvegarder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- profile-manager.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/profile-manager.sh b/profile-manager.sh index 0210a78..0928813 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -44,12 +44,13 @@ mp\nModifier un profil (connaissance en ligne de commande borg requise)\ ### Créer un nouveau profil/dépôt ### if [ "$choixmenu" = "cp" ];then - +cd $HOME +zenity $W --info --text="Séléctionnez maintenant le dossier contenant votre dépôt, généralement sur un disque dur externe.\nCe dossier doit être vide." borg_repo=$(zenity --title "Dossier du dépôt" --file-selection --directory) -if [ ! -z "$(ls -A "$borg_repo")" ]; then +while [ ! -z "$(ls -A "$borg_repo")" ];do zenity $W --error --text="Erreur, le dossier n'est pas vide." -exit -fi +borg_repo=$(zenity --title "Dossier du dépôt" --file-selection --directory) +done zenity $W --question --text "Chiffrer le dépôt ?\n\n\ Si vous chiffrez le dépôt, le fichier-clé du dépôt sera stocké dans le dossier $HOME/.config/borg/keys/.\n\ @@ -69,6 +70,7 @@ elif [ "$?" = "1" ];then repo_status="non chiffré" fi +zenity $W --info --text="Séléctionnez maintenant le dossier à sauvegarder dans Borg-Zenity." borg_dir=$(zenity --title "Dossier à sauvegarder" --file-selection --directory) profilename=$(zenity --entry --title "Nom de profil" --text "Nom de profil (pas d'espace ni caractères spéciaux)") nomsauvegarde=$(echo "$profilename") From 16962d5f06181e91ed261818ff98660bfbda00fa Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 29 Oct 2022 13:33:32 +0200 Subject: [PATCH 47/53] =?UTF-8?q?ajout=20de=20la=20fonction=20de=20d=C3=A9?= =?UTF-8?q?sinstallation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 ++ readme.md | 5 +++++ uninstall.sh | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index fe75e41..890ead9 100644 --- a/install.sh +++ b/install.sh @@ -33,6 +33,7 @@ su -c "cp -fv borg-zenity-sauvegarde.desktop /usr/share/applications/" su -c "cp -fv borg-zenity-gestprofils.desktop /usr/share/applications/" su -c "cp -fv borg-gui.sh /opt/borg-zenity/" su -c "cp -fv profile-manager.sh /opt/borg-zenity/" +su -c "cp -fv uninstall.sh /opt/borg-zenity/" else # Copie des fichiers @@ -44,6 +45,7 @@ sudo cp -fv borg-zenity-sauvegarde.desktop /usr/share/applications/ sudo cp -fv borg-zenity-gestprofils.desktop /usr/share/applications/ sudo cp -fv borg-gui.sh /opt/borg-zenity/ sudo cp -fv profile-manager.sh /opt/borg-zenity/ +sudo cp -fv uninstall.sh /opt/borg-zenity/ fi # réglages des droits diff --git a/readme.md b/readme.md index 4784eb3..920a24f 100644 --- a/readme.md +++ b/readme.md @@ -14,3 +14,8 @@ wget -O borg-zenity.zip https://git.djan-gicquel.fr/djan/borg-zenity/archive/dev ``` Cette commande va télécharger les fichiers d'installation et exécuter le script d'installation. +## Désinstallation +Copier cette ligne dans le terminal. +``` +sudo bash /opt/borg-zenity/uninstall.sh +``` diff --git a/uninstall.sh b/uninstall.sh index b455268..395c65e 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -6,8 +6,7 @@ sudo rm -vf /usr/share/icons/borgzenity-profils.svg sudo rm -vf /usr/share/icons/borgzenity-sauvegarde.svg sudo rm -vf /usr/share/applications/borg-zenity-sauvegarde.desktop sudo rm -vf /usr/share/applications/borg-zenity-gestprofils.desktop -sudo rm -vf /opt/borg-zenity/borg-gui.sh -sudo rm -vf /opt/borg-zenity/profile-manager.sh +sudo rm -vrf /opt/borg-zenity/ echo "--------------------" echo "Désinstallation terminée." From 6370975be027783e616668cd0cb116b7d8c7f5b4 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sat, 29 Oct 2022 20:36:03 +0200 Subject: [PATCH 48/53] ajout dans le readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 920a24f..2e6ecb0 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Pre-requis : Borg-zeniy utilise `borgbackup` et `zenity` pour fonctionner. Le script devrait les installer automatiquement en détectant votre distribution. S'il n'y parvient pas vous devrez les installer manuellement. -## Installation (version de développement) +## Installation et mise à jour (version de développement) Avant tout sachez que la version dans la branche `dev` est encore en test. L'installation devrait pouvoir se faire en une ligne de commande. Copiez ceci dans votre terminal. ``` From e97cb0ea06733a4bbadc8f287554b8527d649396 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 6 Nov 2022 09:14:58 +0100 Subject: [PATCH 49/53] typo dans la variable MenuQuitter --- borg-gui.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index a35b75c..e671c99 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -153,7 +153,7 @@ MenuFiltre="fi\nFiltre : "$filter"\n" MenuBarreHorizontale="--\n------------------------------------------\n" MenuInfoDepot="id\nInformation sur le dépôt\n" MenuAfficherProfil="ap\nAfficher le profil\n" -MenuQuitter="qu\nQUITTER\n" +MenuQuitter="qu\nQUITTER" ################################################################################# # Affichage du menu @@ -180,8 +180,7 @@ $(echo $MenuAfficherProfil)\ $(echo $MenuBarreHorizontale)\ $(echo $MenuEspaceDisque)\ $(echo $MenuQuitter)\ -" | zenity $iconborg --list $H $W --title "$nomsauvegarde" \ ---hide-header --hide-column=1 --column "id" --column "choix") +" | zenity $iconborg --list $H $W --title "$nomsauvegarde" --hide-header --hide-column=1 --column "id" --column "choix") else @@ -194,8 +193,7 @@ $(echo $MenuDemonter)\ $(echo $MenuSupprimer1)\ $(echo $MenuEspaceDisque)\ $(echo $MenuQuitter)\ -" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" \ ---hide-header --hide-column=1 --column "id" --column "choix") +" | zenity $iconborg --list $H $W --title "BORG GUI : $nomsauvegarde" --hide-header --hide-column=1 --column "id" --column "choix") fi From 288e52381e9deb1c4045fcc4c922e0a4afed970b Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 6 Nov 2022 10:46:00 +0100 Subject: [PATCH 50/53] =?UTF-8?q?r=C3=A9=C3=A9criture=20fonction=20TestBor?= =?UTF-8?q?gRepo=20gestion=20verbeuse=20en=20cli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index e671c99..be45c97 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -23,22 +23,41 @@ iconborg="--window-icon=/usr/share/icons/borg.svg" # FONCTIONS ################################################################################# TestBorgRepo () { - if [ ! -f "config" ]; then + if [ ! -d "$borg_repo" ];then + zenity $W --error --text="Impossible de trouver de dépôt borg." + exit + else + echo "[OK] Le dépôt borg existe" + fi + + if ! ls "$borg_repo";then + zenity $W --error --text="Impossible d'accéder au dépôt borg.\nIl s'agit probablement d'un problème de droits" + exit + else + echo "[OK] L'accès au dépôt borg est possible" + fi + + if ! ls "$borg_repo/data";then + zenity $W --error --text="Impossible d'accéder aux données du dépôt borg.\nIl s'agit probablement d'un problème de droits" + exit + else + echo "[OK] L'accès aux données du dépôt borg est possible" + fi + + if [ ! -f "$borg_repo/config" ]; then infoerr="Impossible de trouver le fichier de configuration borg." zenity $W --error --text="$infoerr" exit + else + echo "[OK] Le fichier de configuration a été trouvé" fi - if [ ! -d "data" ]; then - infoerr="Impossible de trouver le fichier de configuration borg." - zenity $W --error --text="$infoerr" - exit - fi - - if [ -d "lock.exclusive" ]; then + if [ -d "$borg_repo/lock.exclusive" ]; then infoerr="Le dépôt est verrouillé, une opération est peut-être en cours" zenity $W --error --text="$infoerr" exit + else + echo "[OK] Le dépôt n'est pas verrouillé" fi } @@ -90,14 +109,7 @@ elif [ "$borg_repo" = "" ]; then exit fi - -if ! cd "$borg_repo" ;then - zenity $W --error --text="Impossible de trouver de dépôt borg." - exit -else - TestBorgRepo -fi - +TestBorgRepo ################################################################################# # Fichier de configuration globale From 4350705ef572310a4ffe47bd0979b719ef4b150d Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 27 Nov 2022 21:02:58 +0100 Subject: [PATCH 51/53] =?UTF-8?q?fonctions=20:=20ZenityPulsate=20ajout=20p?= =?UTF-8?q?aram=20posit,=20ajout=20ZenityNotification=20r=C3=A9=C3=A9critu?= =?UTF-8?q?re=20verbeuse=20des=20appel=20aux=20fonct=20ZenityPulsate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- borg-gui.sh | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/borg-gui.sh b/borg-gui.sh index be45c97..5cd0d7a 100755 --- a/borg-gui.sh +++ b/borg-gui.sh @@ -70,11 +70,16 @@ DossierPresent () { } ZenityPulsate () { - zenity $W $iconborg --progress --pulsate --auto-close + zenity $W $iconborg --title "borg-zenity" --progress --pulsate --auto-close --text "$1" +} + +ZenityNotification () { + zenity $iconborg --notification --text "$1" } BorgFilter () { if [ "$filter" = "" ];then + ZenityNotification "borg-zenity\nGénération de la liste des archives en cours..." BorgArchiveList=$(borg list --short "$borg_repo") Borg_Archive=$(echo -e "$BorgArchiveList" | zenity $H $W $iconborg --list --title "Listes des archives" --column "Archive") else @@ -92,7 +97,8 @@ 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"\ +--column "Fichier de profil" \ +--hide-header \ ) && . "$dossierprofil"/"$fichierprofil".conf if [ "$fichierprofil" = "" ]; then @@ -155,7 +161,7 @@ fi # notification si espace disque faible NotificationEspaceDisque () { if [ $EspaceDisqueUtil -gt $seuil_alerte_espace_disque ];then - zenity --window-icon warning --notification --text="borg-zenity\nEspace disque faible, $EspaceDisqueUtil% occupé" + ZenityNotification "borg-zenity\nEspace disque faible, $EspaceDisqueUtil% occupé" fi } @@ -234,13 +240,13 @@ fi else if [ "$VarDossierPresent" != "false" ];then log="/tmp/borg-zenity-$borg_archive-$(date +%H-%M-%S).log" - borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" . 2> "$log" | zenity $W $iconborg --progress --pulsate --auto-close --no-cancel + borg create ${borg_excludes} ${borg_compress} "$borg_repo"::"$borg_archive" . 2> "$log" | zenity $W $iconborg --progress --pulsate --auto-close --no-cancel --text "Sauvegarde en cours..." --title "borg-zenity" chmod 777 "$log" if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" fi - sync | ZenityPulsate - zenity $iconborg --notification --text "Sauvegarde $nomsauvegarde terminée" + sync | ZenityPulsate "Synchronisation des écritures..." + ZenityNotification "borg-zenity\nSauvegarde $nomsauvegarde terminée" zenity $W --info --text "Sauvegarde $nomsauvegarde terminée" fi fi @@ -251,7 +257,7 @@ fi BorgFilter if [ ! "$Borg_Archive" = "" ];then mkdir $HOME/"$Borg_Archive" - borg mount "$borg_repo"::"$Borg_Archive" $HOME/"$Borg_Archive" | ZenityPulsate + borg mount "$borg_repo"::"$Borg_Archive" $HOME/"$Borg_Archive" | ZenityPulsate "Montage de l'archive..." zenity $W --info --text="La sauvegarde est disponible dans le dossier\n$HOME/$Borg_Archive" fi @@ -259,17 +265,17 @@ fi # Démonter une archive ptnmontage=$(mount | grep borgfs | cut -d" " -f3 | zenity $W $H $iconborg --list --title "Liste des points de montages" --column "Archive") if [ ! "$ptnmontage" = "" ];then - fusermount -u "$ptnmontage" | ZenityPulsate - sleep 2 | ZenityPulsate - rmdir "$ptnmontage" | ZenityPulsate + fusermount -u "$ptnmontage" | ZenityPulsate "Démontage de l'archive..." + sleep 2 | ZenityPulsate "" + rmdir "$ptnmontage" | ZenityPulsate "Suppression du point du montage..." fi - zenity --notification $iconborg --text="Démontage de $ptnmontage" + ZenityNotification "borg-zenity\nDémontage de $ptnmontage" elif [ "$choixmenu" = "dmt" ];then # Démonter toutes les archives while [ $(mount | grep borgfs | cut -d" " -f3 | head -n 1) ];do ptnmontage="$(mount | grep borgfs | cut -d" " -f3 | head -n 1)" - zenity --notification $iconborg --text="Démontage de $ptnmontage" + ZenityNotification "borg-zenity\nDémontage de $ptnmontage" fusermount -uz "$ptnmontage" && sleep 2 && rmdir "$ptnmontage" done @@ -278,7 +284,7 @@ fi # Supprimer une archive BorgFilter if [ ! "$Borg_Archive" = "" ];then - borg delete "$borg_repo"::"$Borg_Archive" | ZenityPulsate + borg delete "$borg_repo"::"$Borg_Archive" | ZenityPulsate "Suppresion de l'archive..." zenity $W --info --text="Suppresion de l'archive $Borg_Archive terminée" fi @@ -292,13 +298,13 @@ fi fi if [ ! "$Borg_Archive" = "" ];then - borg delete "$borg_repo"::$(echo "$Borg_Archive" | sed s/\|/\ /g) | ZenityPulsate + borg delete "$borg_repo"::$(echo "$Borg_Archive" | sed s/\|/\ /g) | ZenityPulsate "Suppression de l'archive..." zenity $W --info --text="Suppression des archives terminée.\nArchives supprimées : $(echo "$Borg_Archive" | sed s/\|/\ /g)" fi elif [ "$choixmenu" = "co" ];then # Compacter le dépôt - borg compact --verbose "$borg_repo" 2> /tmp/borg-compact.log | ZenityPulsate + borg compact --verbose "$borg_repo" 2> /tmp/borg-compact.log | ZenityPulsate "Compactage du dépôt..." zenity $W --info --text "$(cat /tmp/borg-compact.log)" elif [ "$choixmenu" = "ra" ];then @@ -308,12 +314,12 @@ fi if [ ! "$Borg_Archive" = "" ];then borg_nouveaunom=$(zenity $W --entry --text "Nouveau nom" --entry-text="$Borg_Archive") if [ "$borg_nouveaunom" = "$Borg_Archive" ];then - zenity --notification $iconborg --text="Renommage annulé" + ZenityNotification "Renommage annulé" elif [ "$borg_nouveaunom" = "" ];then - zenity --notification $iconborg --text="Renommage annulé" + ZenityNotification "Renommage annulé" elif [ "$Borg_Archive" != "$borg_nouveaunom" ];then - borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate - zenity --notification $iconborg --text="Renommage terminé\n"$Borg_Archive" -> "$borg_nouveaunom"" + borg rename "$borg_repo"::"$Borg_Archive" "$borg_nouveaunom" | ZenityPulsate "Renommage de l'archive..." + ZenityNotification "Renommage terminé\n"$Borg_Archive" -> "$borg_nouveaunom"" fi fi @@ -321,7 +327,7 @@ fi # Information archive BorgFilter if [ ! "$Borg_Archive" = "" ];then - zenity $W --info --text="$(borg info "$borg_repo"::"$Borg_Archive")" | ZenityPulsate + zenity $W --info --text="$(borg info "$borg_repo"::"$Borg_Archive")" | ZenityPulsate "Récupération des informations..." fi elif [ "$choixmenu" = "fi" ];then @@ -330,7 +336,7 @@ fi elif [ "$choixmenu" = "id" ];then # Information sur le dépôt - zenity $W --info --text="$(borg info "$borg_repo")" | ZenityPulsate + zenity $W --info --text="$(borg info "$borg_repo")" | ZenityPulsate "Récupération des informations..." elif [ "$choixmenu" = "ap" ];then # Afficher le profil From c0b8366456b147d0c1d5907d6f24b33ab7f56520 Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Sun, 27 Nov 2022 21:07:29 +0100 Subject: [PATCH 52/53] typo --- uninstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uninstall.sh b/uninstall.sh index 395c65e..4fc82cc 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -10,4 +10,4 @@ sudo rm -vrf /opt/borg-zenity/ echo "--------------------" echo "Désinstallation terminée." -echo "Vous pouvez supprimmer la configuration manuellement dans ~/.config/borg/" +echo "Vous pouvez supprimer la configuration manuellement dans ~/.config/borg/" From cf27f0aa00f27a9fa01ff831b4b2757ad54eca4f Mon Sep 17 00:00:00 2001 From: Djan GICQUEL <> Date: Wed, 15 Mar 2023 15:56:56 +0100 Subject: [PATCH 53/53] Correction de tournures de phrase --- profile-manager.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile-manager.sh b/profile-manager.sh index 0928813..cf1eb70 100755 --- a/profile-manager.sh +++ b/profile-manager.sh @@ -45,7 +45,7 @@ mp\nModifier un profil (connaissance en ligne de commande borg requise)\ if [ "$choixmenu" = "cp" ];then cd $HOME -zenity $W --info --text="Séléctionnez maintenant le dossier contenant votre dépôt, généralement sur un disque dur externe.\nCe dossier doit être vide." +zenity $W --info --text="Séléctionnez maintenant le dossier qui contiendra votre dépôt, généralement sur un disque dur externe.\nCe dossier doit être vide." borg_repo=$(zenity --title "Dossier du dépôt" --file-selection --directory) while [ ! -z "$(ls -A "$borg_repo")" ];do zenity $W --error --text="Erreur, le dossier n'est pas vide." @@ -99,6 +99,7 @@ Statut du dépôt : $repo_status" elif [ "$choixmenu" = "ajd" ];then +zenity $W --info --text="Séléctionnez maintenant le dossier qui contient votre dépôt. Il est généralement localisé sur un disque dur externe." TestBorgErr="true" while [ "$TestBorgErr" = "true" ];do borg_repo_test=$(zenity --title "Dossier du dépôt" --file-selection --directory)