Sunday 24 April 2016

Small shell script to gather VCS configuration backup

Given below is an easy to use script that gathers some useful information related to VCS.

#!/usr/bin/bash
echo "gathering VCS information for server" `hostname`
mkdir -p /var/tmp/`hostname`_VCSinfo_`date "+%d/%m/%y"`
CWD=/var/tmp/`hostname`_VCSinfo_`date "+%d/%m/%y"`
cd $CWD
echo "------------------------------------------"
echo "gathering LLT & GAB information"

cat /etc/llthosts >> llthosts.txt
cat /etc/llttab >> llttab.txt
cat /etc/gabtab >> gabtab.txt
cat /etc/VRTSvcs/conf/config/main.cf >> main_cf.txt
lltstat -nvv >> lltstat.txt
gabconfig -a >> gabconfig_a.txt

echo "------------------------------------------"
echo "gathering HA information"

haclus -display >> haclus_display.txt
hauser -display >> hauser_display.txt
hasys -state >> hasys_state.txt
hasys -display >. hasys_display.txt
hastatus -summary >> hastatus_summary.txt
hagrp -display >> hagrp_display.txt
hares -display >> hares_display.txt
echo "------------------------------------------"
echo "script is complete"

No comments:

Post a Comment

Using capture groups in grep in Linux

Introduction Let me start by saying that this article isn't about capture groups in grep per se. What we are going to do here with gr...