Rancid is fantastic tool to backup configuration and track configuration changes.You can use CSV or SVN to manage configuration repositories.
One issue is that if you need to delete a device or directory from Rancid, it’s not that straight forward.
Essentially if you are using CSV as Rancid repository there is no way to delete an entry, but using SVN below commands will help you.
First of all find the base directory used by Rancid:
#cat etc/rancid.conf | grep BASEDIR= BASEDIR=/home/rancid/var; export BASEDIR
Then find the SVN Directory (still named as CVSROOT):
#cat etc/rancid.conf | grep CVSROOT= CVSROOT=$BASEDIR/SVN; export CVSROOT
So your SVN Working Directory will be:
List the repository content:
#svn ls file:///home/rancid/var/SVN VIC/ NSW/ SA/ QLD/
List a directory content:
#svn ls file:///home/rancid/var/SVN/VIC vicrtr01 vicrtr02 vicsw01 vicsw02
Delete a file from the repository:
#svn rm file:///home/rancid/var/SVN/VIC/vicrtr01 --message "Deleting"
Delete a directory completely from the repository:
svn rm file:///home/rancid/var/SVN/VIC --message "Deleting"
You can verify by listing the repository again:
#svn ls file:///home/rancid/var/SVN NSW/ SA/ QLD/
CAUTION: When you remove a device from repository, the config files will be deleted too. So if you need your config file take a backup before removing the device from repository.