From f24cf2fdb0351098fdb5cef3fadcc08052b87d3e Mon Sep 17 00:00:00 2001 From: hoganlxj <32036395+hoganlxj@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:18:05 +0800 Subject: [PATCH] Update clean_host.sh --- build/climc/root/opt/yunion/scripts/tools/clean_host.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/climc/root/opt/yunion/scripts/tools/clean_host.sh b/build/climc/root/opt/yunion/scripts/tools/clean_host.sh index e4c203f68c..1afd8a9f3b 100755 --- a/build/climc/root/opt/yunion/scripts/tools/clean_host.sh +++ b/build/climc/root/opt/yunion/scripts/tools/clean_host.sh @@ -47,6 +47,11 @@ do climc server-purge $i > /dev/null done +for i in $(climc server-list --admin --limit 2048 --system --filter "backup_host_id.equals($HOSTID)" | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}') +do + climc server-delete-backup $i > /dev/null +done + echo "3. Clean disks on $HOSTNAME($HOSTID)" for storageid in $(climc host-storage-list --host $HOSTID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')