utilities/tools/collector/debian-scripts/collect_sysadmin.sh
spolice cd620dca5c Modified collect to gather system files from /home/sysadmin
The collect tool is being modified to gather the relevant
system files from /home/sysadmin
to include in collect data.

Test Plan:
PASS: Selected /home/sysadmin files are gathered under collect data,
test passed in both centos and debian.
PASS: No error output on the console,when files are missing.

Story: 2009968
Task: 47284

Signed-off-by: spolice <salma.police@windriver.com>
Change-Id: Icfec1688d597237f11717bd7ce4c8d99d0345ac5
2023-02-17 04:01:59 -05:00

24 lines
573 B
Bash

#! /bin/bash
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Loads Up Utilities and Commands Variables
source /usr/local/sbin/collect_parms
source /usr/local/sbin/collect_utils
SYSADMIN_DIR="${extradir}/sysadmin"
mkdir -p ${SYSADMIN_DIR}
#check files exists and then copy to sysadmin directory
[ -e /home/sysadmin/*.log ] && cp /home/sysadmin/*.log /${SYSADMIN_DIR}/
[ -e /home/sysadmin/*.yml ] && cp /home/sysadmin/*.yml /${SYSADMIN_DIR}/
[ -e /home/sysadmin/*.yaml ] && cp /home/sysadmin/*.yaml /${SYSADMIN_DIR}/
exit 0