Don't fail on nested subvolume
All checks were successful
ShellCheck / shellcheck (push) Successful in 5s
Docker / build (push) Successful in 14s

This commit is contained in:
Andras Schmelczer 2026-09-27 21:53:00 +01:00
commit a5d9ff660e
2 changed files with 7 additions and 11 deletions

View file

@ -11,8 +11,7 @@ snapshot_create() (
children=$(btrfs subvolume list -o "$source") || return 1
if [[ -n $children ]]; then
printf 'Nested subvolumes are not supported under %s:\n%s\n' "$source" "$children" >&2
return 1
printf 'INFO: Nested subvolumes under %s will be omitted from the snapshot; continuing backup:\n%s\n' "$source" "$children"
fi
# Mounted subvolumes may live elsewhere and are absent from the list above.
@ -22,8 +21,7 @@ snapshot_create() (
[[ $mount == "${source%/}/"* && $mount != "$source" ]] || continue
inode=$(stat -c %i -- "$mount") || return 1
if [[ $inode == 256 && -d $mount ]]; then
printf 'Nested subvolumes are not supported: %s\n' "$mount" >&2
return 1
printf 'INFO: Mounted subvolume contents will be omitted from the snapshot; continuing backup: %s\n' "$mount"
fi
done < /proc/self/mountinfo || return 1