changement du test dossier présent

échappement des variables $borg_excludes et $borg_compress
This commit is contained in:
Djan GICQUEL 2022-07-21 21:41:04 +02:00
parent aedbadd834
commit bc4b3e7df3

View File

@ -191,14 +191,20 @@ fi
TestBorgRepo TestBorgRepo
DossierPresent "$borg_repo" 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 if borg list --short "$borg_repo" | grep "$borg_archive" ;then
zenity --warning $W $iconborg --text "L'archive existe déjà." zenity --warning $W $iconborg --text "L'archive existe déjà."
else else
if [ "$VarDossierPresent" != "false" ];then if [ "$VarDossierPresent" != "false" ];then
log="/tmp/borg-zenity-$borg_archive.log" 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" chmod 777 "$log"
if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then if [ $(wc -c "$log" | cut -f1 -d " ") -gt 1 ] ;then
zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)" zenity $W --error --title "borg-zenity erreur" --text "$(cat $log)"