Compare commits

..

1 Commits

Author SHA1 Message Date
MickLesk ccd43fefc1 Keep trimming when pct fstrim fails on one container
pct fstrim exits 255 when the container is locked, for example while a
backup runs ("CT is locked (backup)"). Under errexit the command
substitution ended the whole run there, before the output check below it
and before the remaining containers, and telemetry filed it as
"DPKG: Fatal internal error". Print the result and go on instead.
2026-11-03 10:22:29 +01:00
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -118,7 +118,8 @@ function trim_container() {
fi
local fstrim_output
fstrim_output=$(pct fstrim "$container" 2>&1)
# pct fstrim fails on a locked CT (e.g. a running backup); report it and go on.
fstrim_output=$(pct fstrim "$container" 2>&1) || true
if echo "$fstrim_output" | grep -qi "not supported"; then
echo -e "${RD}fstrim isnt supported on this storage!${CL}"
elif echo "$fstrim_output" | grep -Eq '([0-9]+(\.[0-9]+)?\s*[KMGT]?B)'; then
+1 -1
View File
@@ -31,7 +31,7 @@ check_root() {
select_target_storage_and_container_id() {
echo -e "\nSelect target storage for restored container:\n"
mapfile -t target_storages < <(pvesm status --content rootdir | awk 'NR > 1 {print $1}')
mapfile -t target_storages < <(pvesm status --content images | awk 'NR > 1 {print $1}')
for i in "${!target_storages[@]}"; do
printf "%s) %s\n" "$((i + 1))" "${target_storages[$i]}"
done