diff --git a/autopost/compress.sh b/autopost/compress.sh new file mode 100644 index 0000000..af78e63 --- /dev/null +++ b/autopost/compress.sh @@ -0,0 +1,16 @@ +#!/bin/bash +source /home/$USER/autopost/common.sh +# Recherche récursive des fichiers .nzb dans FINIS +find ${DOSSIER_NZB_FINAL} -type f -name "*.nzb" | while IFS= read -r fichier; do + # Supprime l'extension .nzb pour conserver le chemin complet + fichier_sans_extension="${fichier%.nzb}" + + # Crée l'archive 7z dans le même répertoire que le fichier original + 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on "${fichier_sans_extension}.7z" "$fichier" > /dev/null 2>&1 + + # Si la compression a réussi, supprime le fichier .nzb original + if [ $? -eq 0 ]; then + rm "$fichier" + fi + +done diff --git a/readme.md b/readme.md index 4d7aa66..7b35c27 100644 --- a/readme.md +++ b/readme.md @@ -35,6 +35,13 @@ wget -qO install.sh https://tig.unfr.pw/UNFR/postauto/raw/branch/main/install.sh postauto stop && wget -qO update.sh https://tig.unfr.pw/UNFR/postauto/raw/branch/main/update.sh && chmod +x update.sh && ./update.sh ``` +##### Update passage EN 7z (12/03/2024) + +```sh +cd autopost +wget -qO compress.sh https://tig.unfr.pw/UNFR/postauto/raw/branch/main/compress.sh && chmod +x compress.sh && ./compress.sh +``` + #### Configuration. Éditer le fichier /home/$USER/autopost/conf.sh ```sh