[rancid] ignoring DHCP database files in flash

Lee ler762 at gmail.com
Thu Oct 7 20:45:42 UTC 2010


On 10/6/10, john heasley <heas at shrubbery.net> wrote:
> Wed, Oct 06, 2010 at 02:39:06PM -0400, Lee:
>> The  DHCP database files weren't being ignored on c2800 routers:
>>
>> @@ -25,13 +25,13 @@
>>   !Flash: 8       194060 Jan 24 2009 02:19:30 atro_main2.au
>>   !Flash: 10      322058 Jan 30 2010 00:58:38 atro_aa.au
>>   !Flash: 11      462058 Apr 02 2010 15:16:38 atro_aa_4_2.au
>>   !Flash: 12      384058 May 07 2010 23:00:40 atro_aa_5_7.au
>>   !Flash: 13    59478200 Jun 03 2010 23:44:28
>> c2800nm-adventerprisek9-mz.124-24.T3.bin
>>   !Flash: 14      384058 May 17 2010 23:37:08 ATRO_AA_5_17.au
>> - !Flash: 15        4235 Oct 06 2010 09:37:44 dhcp_database.txt
>> + !Flash: 15        4235 Oct 06 2010 16:18:50 dhcp_database.txt
>>
>> sub ShowFlash also needs to ignore DHCP database files:
>>
>> diff -U 6 rancid-2.3.5/bin/rancid ~/rancid/bin/rancid
>> --- rancid-2.3.5/bin/rancid	2010-09-23 10:58:12.000000000 -0400
>> +++ ~/rancid/bin/rancid	2010-10-06 13:22:37.000000000 -0400
>> @@ -695,12 +695,13 @@
>>      print STDERR "    In ShowFlash: $_" if ($debug);
>>
>>      while (<INPUT>) {
>>  	tr/\015//d;
>>  	last if (/^$prompt/);
>>  	next if (/^(\s*|\s*$cmd\s*)$/);
>> +       next if (/dhcp[-_]database/);		;# --LR--
>
> rancid 2.3.5 already ignores
>
>         if (/dhcp_[^. ]*\.txt/) {

Which is why I included an example of the file "dhcp_database.txt"
showing up in the change log.  rancid 2.3.5 has
>         if (/dhcp_[^. ]*\.txt/) {
only in sub DirSlotN - you need another test for ignoring dhcp files
in sub ShowFlash

Regards,
Lee


More information about the Rancid-discuss mailing list