myvesta / vesta

myVESTA Control Panel
https://myvestacp.com
GNU General Public License v3.0
266 stars 46 forks source link

backup failed not enough disk space available to perform the backup #158

Open suscr opened 1 year ago

suscr commented 1 year ago

Describe the bug:

When the backup script runs, it does not factor in any exclusions in the user's backup configuration when determining if there's enough disk space available

Noticed a problem while creating a backup. If in a folder that is located in the directory of the site, mount the resource through the samba client with the volume of the surpassing disk of the server. In the control panel there is a condition excluding folder data an error occurs

The condition checks the disk space and the size of the folders, but does not take into account the exclusion rule

if [ "$u_disk" -gt "$v_disk" ]; then
    echo "account size           : $u_account megabytes" |tee $BACKUP/$user.log
    echo "available space on disk: $v_disk megabytes" |tee $BACKUP/$user.log
    echo "needed space on disk   : $u_disk megabytes" |tee $BACKUP/$user.log
    echo "not enough disk space available to perform the backup." |$SENDMAIL -s "$subj" $email $notify
    check_result $E_LIMIT "not enough disk space available to perform the backup."
fi

https://forum.myvestacp.com/viewtopic.php?t=390

hestiacp authors have a solution https://github.com/hestiacp/hestiacp/blob/main/bin/v-backup-user

myvesta commented 1 year ago

Nice function, we must test it, in case incompatibility between forks. We will put this in TODO list.