Version control Rancid/VieWVC-cvs-仅保留最新版本/删除旧版本

Version control Rancid/VieWVC-cvs-仅保留最新版本/删除旧版本,version-control,version,cvs,revision-history,jus,Version Control,Version,Cvs,Revision History,Jus,我使用Rancid和ViewVC作为“前端”,用于查看网络设备的配置文件 我只想保留所有设备的最新版本号,并删除旧设备 cvs -d /usr/local/rancid/var/CVS rlog Switches 输出示例: RCS file: /usr/local/rancid/var/CVS/Switches/configs/Attic/1.1.1.1,v head: 1.3 branch: locks: strict access list: symbolic names: keywor

我使用Rancid和ViewVC作为“前端”,用于查看网络设备的配置文件

我只想保留所有设备的最新版本号,并删除旧设备

cvs -d /usr/local/rancid/var/CVS rlog Switches
输出示例:

RCS file: /usr/local/rancid/var/CVS/Switches/configs/Attic/1.1.1.1,v
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: o
total revisions: 3;     selected revisions: 3
description:
----------------------------
revision 1.3
date: 2020/01/17 11:39:40;  author: rancid;  state: dead;  lines: +0 -0
deleted router 1.1.1.1
----------------------------
revision 1.2
date: 2020/01/17 11:00:14;  author: rancid;  state: Exp;  lines: +2 -0
updates
----------------------------
revision 1.1
date: 2020/01/17 08:23:44;  author: rancid;  state: Exp;
new router
=============================================================================

RCS file: /usr/local/rancid/var/CVS/Switches/configs/1.1.1.2,v
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: o
total revisions: 2;     selected revisions: 2
description:
----------------------------
revision 1.2
date: 2020/01/20 07:29:34;  author: rancid;  state: Exp;  lines: +578 -0
updates
----------------------------
revision 1.1
date: 2020/01/17 11:57:40;  author: rancid;  state: Exp;
new router
=============================================================================

RCS file: /usr/local/rancid/var/CVS/Switches/configs/1.1.1.3,v
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: o
total revisions: 2;     selected revisions: 2
description:
----------------------------
revision 1.2
date: 2020/01/17 11:39:57;  author: rancid;  state: Exp;  lines: +535 -0
updates
----------------------------
revision 1.1
date: 2020/01/17 11:39:39;  author: rancid;  state: Exp;
new router
=============================================================================

RCS file: /usr/local/rancid/var/CVS/Switches/configs/1.1.1.4,v
head: 1.10
branch:
locks: strict
access list:
symbolic names:
keyword substitution: o
total revisions: 10;    selected revisions: 10
description:
----------------------------
revision 1.10
date: 2020/01/16 13:42:54;  author: rancid;  state: Exp;  lines: +245 -0
updates
----------------------------
revision 1.9
date: 2020/01/16 13:42:44;  author: rancid;  state: Exp;  lines: +0 -245
new router
----------------------------
revision 1.8
date: 2020/01/16 13:41:20;  author: rancid;  state: dead;  lines: +0 -0
deleted router 1.1.1.4
----------------------------
revision 1.7
date: 2020/01/16 13:37:12;  author: rancid;  state: Exp;  lines: +245 -0
updates
----------------------------
revision 1.6
date: 2020/01/16 13:37:05;  author: rancid;  state: Exp;  lines: +0 -245
new router
----------------------------
revision 1.5
date: 2020/01/16 13:29:54;  author: rancid;  state: dead;  lines: +0 -0
deleted router 1.1.1.4
----------------------------
revision 1.4
date: 2020/01/16 11:33:03;  author: rancid;  state: Exp;  lines: +245 -0
updates
----------------------------
revision 1.3
date: 2020/01/16 11:23:45;  author: rancid;  state: Exp;  lines: +0 -0
new router
----------------------------
revision 1.2
date: 2020/01/16 11:16:27;  author: rancid;  state: dead;  lines: +0 -0
deleted router 1.1.1.4
----------------------------
revision 1.1
date: 2020/01/16 11:00:01;  author: rancid;  state: Exp;
new router
只是为了测试一下,从
/usr/local/rancid
我试过了

cvs -d /usr/local/rancid/var/CVS admin -o :"1.1" Switches
但是

cvs admin: cannot open CVS/Entries for reading: No such file or directory
cvs admin: nothing known about 1.1.1.1,v
cvs管理员:/usr/local/rancid/var/cvs/Switches/configs/1.1.2,v:Revision rev 1.1不存在

尝试使用特定文件:

cvs -d /usr/local/rancid/var/CVS admin -o :"1.1" Routers/configs/1.1.1.1,v

 cvs -d /usr/local/rancid/var/CVS admin -o :"1.1" /usr/local/rancid/var/CVS/Routers/configs/1.1.1.1,v 
但是

cvs admin: cannot open CVS/Entries for reading: No such file or directory
cvs admin: nothing known about 1.1.1.1,v

好的,算出了,只需退出`/usr/local/rancid/var/”路径,例如/tmp

和类型
cvs-d/usr/local/rancid/var/cvs校验开关

然后执行

cvs -d /usr/local/rancid/var/CVS admin -o :1.1 Switches/config/1.1.1.1
并删除所有带有1.1的修订