Error: not enough diskspace available to perform the backup

After migration from vestacp to hestiacp, I found that the automatic user backups are not created. I use local backups. I ran the command “/usr/local/hestia/bin/v-backup-user user1 yes” and saw a message saying Error: not enough diskspace available to perform the backup. This was strange and I opened up the source code of the script to see how it checks for free disk space. It turns out that it calculates the space occupied by the user and multiplies it by 2. Then it checks to see if the server has that much free space.

This is pretty weird. I have a 1tb HDD disk and 400 gb data. I use exceptions and the clear backup size takes about 5 gb. The problem is that the exclusion rules are ignored when calculating the backup size. As a result, if you fill the disk space more than 33.3%, you can’t back it up. Even if the backup really takes up 1% of the free space.

How to solve this problem?

my /usr/local/hestia/data/queue/backup.pipe:

/usr/local/hestia/bin/v-backup-user user1 yes >> /usr/local/hestia/log/backup.log 2>&1

my df -h

Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 794M 2.2M 792M 1% /run
/dev/sda3 899G 418G 436G 49% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 487M 125M 333M 28% /boot
tmpfs 794M 0 794M 0% /run/user/1002
tmpfs 794M 0 794M 0% /run/user/1000

P.S. I see, that in vestacp script that free space test works any way.

hestiacp:

Validate available disk space (take usage * 2, due to the backup handling)

let u_disk=$(grep “U_DISK=” $HESTIA/data/users/$user/user.conf |cut -f 2 -d ')2
let v_disk=$(($(stat -f --format="%a
%S" $BACKUP)))/1024/1024

if [ “$u_disk” -gt “$v_disk” ]; then
echo “not enough diskspace available to perform the backup.” |$SENDMAIL -s “$subj” $email $notify
check_result $E_LIMIT “not enough diskspace available to perform the backup.”

vestacp:

Checking disk space

disk_usage=$(df $BACKUP |tail -n1 |tr ' ' '\n' |grep % |cut -f 1 -d %)
if [ "$disk_usage" -ge "$BACKUP_DISK_LIMIT" ]; then
    rm -rf $tmpdir
    rm -f $BACKUP/$user.log
    sed -i "/ $user /d" $VESTA/data/queue/backup.pipe
    echo "Not enough disk space" |$SENDMAIL -s "$subj" $email $notify
    check_result "$E_DISK" "Not enough dsk space"
fi

But I still don’t know how to solve the problem

Exclusions are not calculated in the required backup calculation.

probably easiest to comment that check / if-section for now. however, keep in mind that the scripts might get overwritten during future updates.