Skip to content

Instantly share code, notes, and snippets.

@sulrich
Last active December 20, 2022 19:08
Show Gist options
  • Save sulrich/2c8aa2c7348879e663b8283630579819 to your computer and use it in GitHub Desktop.
Save sulrich/2c8aa2c7348879e663b8283630579819 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" = "" ]
then
cat <<EOFUSAGE
usage:
case-blurb <case-number> - where the case-number is a whitespace-free string
EOFUSAGE
exit
fi
sed "s/%%CASE_NUM%%/${1}/g" <<EOF
show tech-support | gzip > /mnt/flash/%%CASE_NUM%%-show-tech-$HOSTNAME-$(date +%m_%d.%H%M).log.gz
show agent log | gzip > /mnt/flash/%%CASE_NUM%%-show-agentlog-$HOSTNAME-$(date +%m_%d.%H%M).log.gz
bash sudo tar -cvf - /var/log/qt/ > /mnt/flash/%%CASE_NUM%%-qt-logs-$HOSTNAME-$(date +%m_%d.%H%M).tar.gz
show agent qtrace | gzip >/mnt/flash/%%CASE_NUM%%-show-agentqt-$HOSTNAME-$(date +%m_%d.%H%M).log.gz
show logging system | gzip >/mnt/flash/%%CASE_NUM%%-show-logsys-$HOSTNAME-$(date +%m_%d.%H%M).log.gz
bash sudo tar -czvf - /mnt/flash/schedule/tech-support/* > /mnt/flash/%%CASE_NUM%%-history-tech-$HOSTNAME-$(date +%m_%d.%H%M).tar.gz
bash sudo tar -czvf - /mnt/flash/archive/current/var/core > /mnt/flash/%%CASE_NUM%%-cores-$HOSTNAME-$(date +%m_%d.%H%M).tar.gz
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment