Rancid: Delete/Remove a File or Directory from SVN Repository

Welcome To Prasad Linux Blog

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:

/home/rancid/var/SVN

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…

View original post 48 mots de plus

Laisser un commentaire

Choisissez une méthode de connexion pour poster votre commentaire:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s