[NAS Backup] Suppress Errors in Disk Usage Calculation that Caused Backup to Fail (#13424)

This commit is contained in:
Davi Torres 2026-07-07 09:02:11 -04:00 committed by GitHub
parent 89b2b030e0
commit f9a9451860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ BACKUP_DIR=""
DISK_PATHS=""
QUIESCE=""
logFile="/var/log/cloudstack/agent/agent.log"
UNMOUNT_TIMEOUT=60
EXIT_CLEANUP_FAILED=20
log() {
@ -197,10 +197,10 @@ backup_running_vm() {
# Print statistics
virsh -c qemu:///system domjobinfo $VM --completed
du -sb $dest | cut -f1
umount $mount_point
rmdir $mount_point
backup_size=$(du -sb "$dest" 2>>"$logFile" | cut -f1) || { log -ne "WARNING: du failed for $dest, reporting size as 0"; backup_size=0; }
timeout "$UNMOUNT_TIMEOUT" umount "$mount_point" 2>>"$logFile" || { log "WARNING: umount of $mount_point failed or timed out"; true; }
rmdir "$mount_point" 2>>"$logFile" || { log "WARNING: rmdir of $mount_point failed"; true; }
echo "$backup_size"
}
backup_stopped_vm() {