Ticket ID #292 ‐ Develop Comprehensive Backup Strategy for Server Infrastructure - GriffinKat/group-a GitHub Wiki
Backup and recovery plan
Catalog of critical data on each server
Management Server Critical Data
Application Server Critical Data
Database Server Critical Data
Backup Server Critical Data
Introduction
The Purpose of our backup and recovery plan is to have very clear instructions on what to do when our server is wiped so we can quickly restore all of the configuration files, databases and system level files
Backup Strategy
Our team has been allocated a backup storage server with the IP Address 20.40.64.18. We can use Rsync to backup directories from our VMs
We will use MySQL dump to backup the database for Mariadb and ownCloud
How to backup each server to remote VM using Rsync
This command pushes a local directory to a remote system
rsync -a ~/dir1 username@remote_host:destination_directory
This command does the opposite and pulls a directory from a remote system onto our server
rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine
Like cp and similar tools, the source is always the first argument, and the destination is always the second
Here are the Rsync commands to push data to our remote server
Management
Puppet
rsync -a /etc/puppetlabs/ [email protected]:/etc/puppetlabs/
Nagios
rsync -a /etc/nagios4/ [email protected]:/etc/nagios4/
rsync -a /etc/nagios-plugins/ [email protected]:/etc/nagios-plugins/
rsync -a /usr/lib/nagios/plugins/ [email protected]:/usr/lib/nagios/plugins/
NTP
rsync -a /etc/ntp.conf [email protected]:/etc/ntp.conf
Firewall
rsync -a /etc/ufw/ [email protected]:/etc/ufw/
System Config
rsync -a /etc/hosts [email protected]:/etc/hosts
rsync -a /etc/hostname [email protected]:/etc/hostname
Application Server
ownCloud
rsync -a /var/www/owncloud/ [email protected]:/var/www/owncloud/
Apache
rsync -a /etc/apache2/ [email protected]:/etc/apache2/
PHP
rsync -a /etc/php/7.4/ [email protected]:/etc/php/7.4/
Puppet Agent
rsync -a /etc/puppetlabs/ [email protected]:/etc/puppetlabs/
NRPE
rsync -a /etc/nagios/nrpe.cfg [email protected]:/etc/nagios/nrpe.cfg
rsync -a /usr/lib/nagios/plugins/ [email protected]:/usr/lib/nagios/plugins/
Firewall
rsync -a /etc/ufw/ [email protected]:/etc/ufw/
System Config
rsync -a /etc/hosts [email protected]:/etc/hosts
rsync -a /etc/hostname [email protected]:/etc/hostname
Database Server
MariaDB Config
rsync -a /etc/mysql/ [email protected]:/etc/mysql/
rsync -a 50-server.cnf [email protected]:50-server.cnf
Puppet Agent Config
rsync -a /etc/puppetlabs/ [email protected]:/etc/puppetlabs/
NRPE Config
rsync -a /etc/nagios/nrpe.cfg [email protected]:/etc/nagios/nrpe.cfg
rsync -a /usr/lib/nagios/plugins/ [email protected]:/usr/lib/nagios/plugins/
rsync -a /etc/nagios-plugins [email protected]:/etc/nagios-plugins
Firewall Rules
rsync -a /etc/ufw/ [email protected]:/etc/ufw/
System Config
rsync -a /etc/hosts [email protected]:/etc/hosts
rsync -a /etc/hostname [email protected]:/etc/hostname
Backup Server
Prometheus
rsync -a /usr/local/bin/prometheus/ [email protected]:/usr/local/bin/prometheus/
rsync -a prometheus.yml [email protected]:prometheus.yml
rsync -a /etc/systemd/system/prometheus.service [email protected]:/etc/systemd/system/prometheus.service
Node Exporter
rsync -a /usr/local/bin/node_exporter/ [email protected]:/usr/local/bin/node_exporter/
rsync -a /etc/systemd/system/node_exporter.service [email protected]:/etc/systemd/system/node_exporter.service
Puppet Agent Config
rsync -a /etc/puppetlabs/puppet/ [email protected]:/etc/puppetlabs/puppet/
NRPE Config
rsync -a /etc/nagios/nrpe.cfg [email protected]:/etc/nagios/nrpe.cfg
rsync -a /usr/lib/nagios/plugins/ [email protected]:/usr/lib/nagios/plugins/
rsync -a /etc/nagios-plugins [email protected]:/etc/nagios-plugins
Firewall Rules
rsync -a /etc/ufw/ [email protected]:/etc/ufw/
System Config
rsync -a /etc/hosts [email protected]:/etc/hosts
rsync -a /etc/hostname [email protected]:/etc/hostname
Recovery Procedures
Here are the commands to restore directories and configuration files
Management Server
Puppet
rsync -a [email protected]:/etc/puppetlabs/ /etc/puppetlabs/
Nagios
rsync -a [email protected]:/etc/nagios4/ /etc/nagios4/
rsync -a [email protected]:/etc/nagios-plugins/ /etc/nagios-plugins/
rsync -a [email protected]:/usr/lib/nagios/plugins/ /usr/lib/nagios/plugins/
NTP
rsync -a [email protected]:/etc/ntp.conf /etc/ntp.conf
Firewall
rsync -a [email protected]:/etc/ufw/ /etc/ufw/
System Config
rsync -a [email protected]:/etc/hosts /etc/hosts
rsync -a [email protected]:/etc/hostname /etc/hostname
Application server
ownCloud
rsync -a [email protected]:/var/www/owncloud/ /var/www/owncloud/
Apache
rsync -a [email protected]:/etc/apache2/ /etc/apache2/
PHP
rsync -a [email protected]:/etc/php/7.4/ /etc/php/7.4/
Puppet Agent
rsync -a [email protected]:/etc/puppetlabs/ /etc/puppetlabs/
NRPE
rsync -a [email protected]:/etc/nagios/nrpe.cfg /etc/nagios/nrpe.cfg
rsync -a [email protected]:/usr/lib/nagios/plugins/ /usr/lib/nagios/plugins/
Firewall
rsync -a [email protected]:/etc/ufw/ /etc/ufw/
System Config
rsync -a [email protected]:/etc/hosts /etc/hosts
rsync -a [email protected]:/etc/hostname /etc/hostname
Database
rsync -a [email protected]:/etc/mysql/ /etc/mysql/
rsync -a [email protected]:50-server.cnf 50-server.cnf
Puppet Agent Config
rsync -a [email protected]:/etc/puppetlabs/ /etc/puppetlabs/
NRPE Config
rsync -a [email protected]:/etc/nagios/nrpe.cfg /etc/nagios/nrpe.cfg
rsync -a [email protected]:/usr/lib/nagios/plugins/ /usr/lib/nagios/plugins/
rsync -a [email protected]:/etc/nagios-plugins /etc/nagios-plugins
Firewall Rules
rsync -a [email protected]:/etc/ufw/ /etc/ufw/
System Config
rsync -a [email protected]:/etc/hosts /etc/hosts
rsync -a [email protected]:/etc/hostname /etc/hostname
Backup
Prometheus
rsync -a [email protected]:/usr/local/bin/prometheus/ /usr/local/bin/prometheus/
rsync -a [email protected]:/usr/local/bin/prometheus/ /usr/local/bin/prometheus/
rsync -a [email protected]:/etc/systemd/system/prometheus.service /etc/systemd/system/prometheus.service
Node Exporter
rsync -a [email protected]:/usr/local/bin/node_exporter/ /usr/local/bin/node_exporter/
rsync -a [email protected]:/etc/systemd/system/node_exporter.service /etc/systemd/system/node_exporter.service
Puppet Agent Config
rsync -a [email protected]:/etc/puppetlabs/puppet/ /etc/puppetlabs/puppet/
NRPE Config
rsync -a [email protected]:/etc/nagios/nrpe.cfg /etc/nagios/nrpe.cfg
rsync -a [email protected]:/usr/lib/nagios/plugins/ /usr/lib/nagios/plugins/
rsync -a [email protected]:/etc/nagios-plugins /etc/nagios-plugins
Firewall Rules
rsync -a [email protected]:/etc/ufw/ /etc/ufw/
System Config
rsync -a [email protected]:/etc/hosts /etc/hosts
rsync -a [email protected]:/etc/hostname /etc/hostname
rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine