mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
Cleaning obsolete helpers
This commit is contained in:
parent
083d8935dc
commit
8088e78966
1 changed files with 0 additions and 22 deletions
|
@ -13,25 +13,3 @@ ynh_multimedia_build_main_dir () {
|
|||
ynh_multimedia_addfolder () {
|
||||
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$1" --dest="$2"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# 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
|
||||
echo "Espace insuffisant pour sauvegarder $file_to_analyse." >&2
|
||||
echo "Espace disponible: $(HUMAN_SIZE $free_space)" >&2
|
||||
ynh_die "Espace nécessaire: $(HUMAN_SIZE $backup_size)"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue