From 7c076a390f99cb72623da7168ae64e2947a25080 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Mon, 6 Jul 2020 11:24:10 -0400 Subject: [PATCH] Exclude temporary subcloud install iso files from collect The collect tool is unnecessarily including temp subcloud install iso files and related other large tmp files. This update changes the raw 'cp ...' to 'rsync ...' with the --exclude option to filter out iso files from the the collect_dc and collect_sysinv collect scripts. Change-Id: I3575c3193a24f376dcd006c3e5015c551023c69a Closes-Bug: 1885778 Signed-off-by: Eric MacDonald --- tools/collector/scripts/collect_dc.sh | 3 ++- tools/collector/scripts/collect_sysinv.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/collector/scripts/collect_dc.sh b/tools/collector/scripts/collect_dc.sh index 317cadd1..b5faeb07 100755 --- a/tools/collector/scripts/collect_dc.sh +++ b/tools/collector/scripts/collect_dc.sh @@ -84,7 +84,8 @@ if [ "$nodetype" = "controller" ] ; then delimiter ${LOGFILE} "dcmanager subcloud-group list" dcmanager subcloud-group list 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE} - cp -a /opt/dc/ansible ${extradir} + # copy the /opt/dc/ansible dir but exclude any iso files + rsync -a --relative --exclude '*.iso' /opt/dc/ansible ${extradir} delimiter ${LOGFILE} "find /opt/dc-vault -ls" find /opt/dc-vault -ls 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE} diff --git a/tools/collector/scripts/collect_sysinv.sh b/tools/collector/scripts/collect_sysinv.sh index 3f27a288..9207b0b3 100755 --- a/tools/collector/scripts/collect_sysinv.sh +++ b/tools/collector/scripts/collect_sysinv.sh @@ -65,7 +65,9 @@ if [ "$nodetype" = "controller" ] ; then delimiter ${LOGFILE} "vm-topology" timeout 60 vm-topology --show all 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE} - cp -a /opt/platform ${extradir} + # copy /opt/platform to extra dir while filtering out the + # iso and lost+found dirs + rsync -a --relative --exclude 'iso' --exclude 'lost+found' /opt/platform ${extradir} fi