diff --git a/scripts/_common.sh b/scripts/_common.sh index 5d01975..dd120b1 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,28 +4,6 @@ # PERSONAL HELPERS #================================================= -#================================================= -# BACKUP -#================================================= - -HUMAN_SIZE () { # Transforme une taille en Ko en une taille lisible pour un humain - human=$(numfmt --to=iec --from-unit=1K $1) - echo $human -} - -CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant - file_to_analyse=$1 - backup_size=$(du --summarize "$file_to_analyse" | cut -f1) - free_space=$(df --output=avail "/home/yunohost.backup" | sed 1d) - - if [ $free_space -le $backup_size ] - then - ynh_print_err "Espace insuffisant pour sauvegarder $file_to_analyse." - ynh_print_err "Espace disponible : $(HUMAN_SIZE $free_space)" - ynh_die "Espace nécessaire : $(HUMAN_SIZE $backup_size)" - fi -} - #================================================= # FUTUR OFFICIAL HELPERS #=================================================