Skip to content
Open
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions scripts/vm/hypervisor/kvm/nasbackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,12 @@ 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>/dev/null | cut -f1) || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @daviftorres
Do we know the exact reason for du to fail? is that a connectivity issue?
This is the only place where the size is set on the backup. And a 0 size will affect resource limit and usage calculations.
May I suggest adding a retry loop instead?


timeout 60 umount "$mount_point" 2>/dev/null || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ok with this, but can we define 60 as a constant at the top of the file?

rmdir "$mount_point" 2>/dev/null || true
Comment on lines +199 to +202
Comment on lines +201 to +202

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we log the error (using log -e) instead of silently returning true here?


Comment thread
daviftorres marked this conversation as resolved.
echo -n "$backup_size"
}

backup_stopped_vm() {
Expand Down
Loading