OK, you’ve got Rancid working and you’re automatically collecting and doing version control on your network device configurations. Great! Except if you’re a network admin and not a developer, and not a veteran Unix admin, or perhaps just used to new version control systems like Git or Bazaar then you may not be familiar with CVS. So you’ve got the configs via Rancid, but now what do you do with them? You could use CVSWeb, but what if you’re a network admin who still prefers the command-line? I thought I’d share some really basic CVS commands to get you started.
The examples below use:
- “
Routers” as the Rancid group-name of interest. You can replace it with whatever group you want to look at. /var/lib/rancidas the Rancid home directory, default for the Ubuntu Rancid package. If you are using a different Linux distro, just replace it with the correct home directory.
CVS checkout:
First you need to checkout a local copy, by default it will go in the current directory.
sudo cvs -d /var/lib/rancid/CVS co Routers
To get status:
sudo cvs -d /var/lib/rancid/CVS status Routers
To get a revision history:
sudo cvs -d /var/lib/rancid/CVS rlog Routers
To compare versions:
sudo cvs -d /var/lib/rancid/CVS diff -r 1.2 -r 1.3 Routers
To replace a file:
Delete the file and use the following command …
sudo cvs -d /var/lib/rancid/CVS update Routers
Tags: Linux, Networking, Rancid