|
|
|
@ -96,14 +96,14 @@ mkdir -p $mydir
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do_rsync() {
|
|
|
|
do_rsync() {
|
|
|
|
rsync -avun --delete --delete-after $1 ${secondary}:${1}
|
|
|
|
rsync -avu --delete --delete-after $1 ${secondary}:${1}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Only backup NagiosQL if it exists
|
|
|
|
# Only backup NagiosQL if it exists
|
|
|
|
if [ -d "/var/www/html/nagiosql" ]; then
|
|
|
|
if [ -d "/var/www/html/nagiosql" ]; then
|
|
|
|
echo "Backing up NagiosQL..."
|
|
|
|
echo "Backing up NagiosQL..."
|
|
|
|
do_rsync /var/www/html/nagiosql
|
|
|
|
do_rsync /var/www/html/nagiosql/
|
|
|
|
do_rsync /etc/nagiosql
|
|
|
|
do_rsync /etc/nagiosql/
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Backing up Nagios Core..."
|
|
|
|
echo "Backing up Nagios Core..."
|
|
|
|
@ -116,26 +116,26 @@ if [ -f "/etc/sysconfig/nagios" ]; then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Backing up Nagios XI..."
|
|
|
|
echo "Backing up Nagios XI..."
|
|
|
|
do_rsync /usr/local/nagiosxi
|
|
|
|
do_rsync /usr/local/nagiosxi/
|
|
|
|
|
|
|
|
|
|
|
|
echo "Backing up MRTG..."
|
|
|
|
echo "Backing up MRTG..."
|
|
|
|
do_rsync /var/lib/mrtg
|
|
|
|
do_rsync /var/lib/mrtg/
|
|
|
|
do_rsync /etc/mrtg/mrtg.cfg
|
|
|
|
do_rsync /etc/mrtg/mrtg.cfg
|
|
|
|
do_rsync /etc/mrtg/conf.d
|
|
|
|
do_rsync /etc/mrtg/conf.d/
|
|
|
|
|
|
|
|
|
|
|
|
# SNMP configs and MIBS
|
|
|
|
# SNMP configs and MIBS
|
|
|
|
echo "Backing up the SNMP directories"
|
|
|
|
echo "Backing up the SNMP directories"
|
|
|
|
do_rsync /etc/snmp
|
|
|
|
do_rsync /etc/snmp/
|
|
|
|
do_rsync /usr/share/snmp
|
|
|
|
do_rsync /usr/share/snmp/
|
|
|
|
|
|
|
|
|
|
|
|
echo "Backing up NRDP..."
|
|
|
|
echo "Backing up NRDP..."
|
|
|
|
do_rsync /usr/local/nrdp
|
|
|
|
do_rsync /usr/local/nrdp/
|
|
|
|
|
|
|
|
|
|
|
|
echo "Backing up Nagvis..."
|
|
|
|
echo "Backing up Nagvis..."
|
|
|
|
do_rsync /usr/local/nagvis
|
|
|
|
do_rsync /usr/local/nagvis/
|
|
|
|
|
|
|
|
|
|
|
|
echo "Backing up nagios user home dir..."
|
|
|
|
echo "Backing up nagios user home dir..."
|
|
|
|
do_rsync /home/nagios
|
|
|
|
do_rsync /home/nagios/
|
|
|
|
|
|
|
|
|
|
|
|
##############################
|
|
|
|
##############################
|
|
|
|
# BACKUP DATABASES
|
|
|
|
# BACKUP DATABASES
|
|
|
|
|