commit 0f0bcf58446cc854397e67c0f6577288f98decf6 Author: Eric MacDonald Date: Fri Oct 16 21:44:10 2020 -0400 Exclude /var/log/crash from collect This update adds support to exclude /var/log/crash content from a collect operation. Additional /var/log content exclusions can be added to the new /etc/collect/varlog.exclude file added by this update. Change-Id: I657ce2552e36cc3ac296f11ecd7ed1331ec0f13e Partial-Fix: 1898602 Signed-off-by: Eric MacDonald diff --git a/tools/collector/centos/build_srpm.data b/tools/collector/centos/build_srpm.data index 9bfcde4..acb43cc 100644 --- a/tools/collector/centos/build_srpm.data +++ b/tools/collector/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="scripts" -TIS_PATCH_VER=33 +TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/tools/collector/centos/collector.spec b/tools/collector/centos/collector.spec index 3133017..68b2289 100644 --- a/tools/collector/centos/collector.spec +++ b/tools/collector/centos/collector.spec @@ -54,6 +54,7 @@ install -m 755 collect_dc.sh %{buildroot}%{_sysconfdir}/collect.d/collect_dc install -m 755 etc.exclude %{buildroot}%{_sysconfdir}/collect/etc.exclude install -m 755 run.exclude %{buildroot}%{_sysconfdir}/collect/run.exclude +install -m 755 varlog.exclude %{buildroot}%{_sysconfdir}/collect/varlog.exclude ln -sf /usr/local/sbin/collect %{buildroot}/usr/local/bin/collect ln -sf /usr/local/sbin/collect %{buildroot}%{_sbindir}/collect diff --git a/tools/collector/scripts/collect_host b/tools/collector/scripts/collect_host index dd5709a..81ce6ec 100755 --- a/tools/collector/scripts/collect_host +++ b/tools/collector/scripts/collect_host @@ -77,6 +77,7 @@ TARBALL="${COLLECT_NAME_DIR}.tgz" COLLECT_PATH="/etc/collect.d" RUN_EXCLUDE="/etc/collect/run.exclude" ETC_EXCLUDE="/etc/collect/etc.exclude" +VAR_LOG_EXCLUDE="/etc/collect/varlog.exclude" COLLECT_INCLUDE="/var/run /etc /root" FLIGHT_RECORDER_PATH="var/lib/sm/" FLIGHT_RECORDER_FILE="sm.eru.v1" @@ -430,7 +431,7 @@ done log_space "before first tar ....:" -(cd ${COLLECT_NAME_DIR} ; ${IONICE_CMD} ${NICE_CMD} ${TAR_CMD} ${COLLECT_NAME_DIR}/${COLLECT_NAME}.tar -T ${VAR_LOG_INCLUDE_LIST} -X ${RUN_EXCLUDE} -X ${ETC_EXCLUDE} ${COLLECT_INCLUDE} 2>>${COLLECT_ERROR_LOG} 1>>${COLLECT_ERROR_LOG} ) +(cd ${COLLECT_NAME_DIR} ; ${IONICE_CMD} ${NICE_CMD} ${TAR_CMD} ${COLLECT_NAME_DIR}/${COLLECT_NAME}.tar -T ${VAR_LOG_INCLUDE_LIST} -X ${RUN_EXCLUDE} -X ${ETC_EXCLUDE} -X ${VAR_LOG_EXCLUDE} ${COLLECT_INCLUDE} 2>>${COLLECT_ERROR_LOG} 1>>${COLLECT_ERROR_LOG} ) log_space "after first tar .....:" diff --git a/tools/collector/scripts/varlog.exclude b/tools/collector/scripts/varlog.exclude new file mode 100644 index 0000000..8b035de --- /dev/null +++ b/tools/collector/scripts/varlog.exclude @@ -0,0 +1 @@ +/var/log/crash