mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-04 20:44:46 +01:00
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.
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user