====== Backups ====== ===== rsync ===== FIXME ===== Proxmox ===== FIXME ===== RANCID ===== ==== Installation ==== First we need to install RANCID, Subversion (that will be used a VCS) and Apache 2 to have a WebSVN instance available. apt-get update apt-get install rancid subversion apache2 php5 ==== Configuration ==== In the ''/etc/rancid/rancid.conf'' file do the following things: - Modify CVSROOT=$BASEDIR/CVS; export CVSROOT by CVSROOT=$BASEDIR/SVN; export CVSROOT - Modify RCSSYS=cvs; export RCSSYS by RCSSYS=svn; export RCSSYS - Add LIST_OF_GROUPS="gravitons" ''gravitons'' will be a directory where the devices configurations will be stored. Initialize the SVN repository where the changes will be tracked: su - rancid ./bin/rancid-cvs The ''gravitons'' directory will be created. ==== Handling Cisco Small Business devices ==== RANCID does not support Cisco Small Business devices by default. It requires some hacks to be able to backup the changes of a SG series devices (for example). As root run the following commands: cd /var/lib/rancid/bin wget 'https://raw.github.com/chrpinedo/rancid-cisco-sb/master/src/csblogin' -O csblogin wget 'https://raw.github.com/chrpinedo/rancid-cisco-sb/master/src/csbrancid' -O csbrancid chmod a+x csb* Also edit the ''rancid-fe'' in ''/var/lib/rancid/bin'' to add the following item in the ''%vendortable'' dictionary. 'cisco-sb' => 'csbrancid' ==== Add device to backup ==== Using the rancid user, create the ''.cloginrc'' file in the home directory and add the following lines to backup a Small Business device: add user sw0.gravitons.in noc add password sw0.gravitons.in noc-password add autoenable sw0.gravitons.in 1 add method sw0.gravitons.in ssh add userprompt sw0.gravitons.in {"User Name:"} Also add the following line to the ''router.db'' file: sw0.gravitons.in:cisco-sb:up If the device was a more //classic// Cisco device we would have used something like this in the ''.clogin'' file: add method sw0.gravitons.in ssh add user sw0.gravitons.in noc add password sw0.gravitons.in noc-password enable-password And this in the ''router.db'' file: sw0.gravitons.in:cisco:up ==== WebSVN ==== With WebSVN it will be possible to have a user-friendly view of what RANCID backups and records. cd /var/www wget 'http://websvn.tigris.org/files/documents/1380/49056/websvn-2.3.3.tar.gz' tar xf websvn-2.3.3.tar.gz mv websvn-2.3.3 svn cp /var/www/svn/include/distconfig.php /var/www/svn/include/config.php chown -R www-data:www-data /var/www/svn Now the following line needs to be added to the WebSVN configuration to see the repository. $config->addRepository(‘RANCID Backup’, ‘file:///var/lib/rancid/SVN/’); Eventually, Apache needs to be able to read the files in the SVN repository. chown -R rancid:www-data /var/lib/rancid/SVN