cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2632
Views
5
Helpful
3
Replies

Easy way to find latest/most recent (5) commits in rollback list

I'd like to see the most recent commits inside of the rollback list inside of NSO, say the 5 most recent.

 

 

When I perform 'rollback configuration ?' I do not get the latest.
Example:
rollback configuration [tab]
rollback configuration 15[tab]

displays:
`15499` to `15598`
however the actual latest is at: `15998`


So it doesn’t show me the end, I have to guess numbers higher than `15[tab]` --> `155[tab]`, it doesn’t show anything about `156...` to `159...`.

 

 

I have found that I can perform searches through the commit list to see different rollbacks with:

    show configuration commit list | include <date or user or label/comment>

 

I can see what the commit changes looks like with:
    show configuration commit changes <number>

 

I can see what the rollback change would be with:
    show configuration rollback changes <number>

 

However I cannot seem to find an easy way to see the latest.

I can find it by doing:
    show configuration commit changes

Then copy and paste the date displayed to the below:

    show configuration commit list | include -a 5 <date>

 

I am curious if there is something that I am missing or if this is the method that must be used to find a grouping of the most recent commits.

1 Accepted Solution

Accepted Solutions

So in the ncs.conf:

/ncs\-config/rollback/history\-size (uint32) [35]

It should only save 35 rollbacks. I can’t say there is an ‘easy’ way to display the most recent to last of the 35 rollback files shown. I asked the BU for suggestions and he recommended making a clispec(5) pipeCmd that runs head(1) or write your own action that list the first number of rollback files.

View solution in original post

3 Replies 3

joepak
Cisco Employee
Cisco Employee

Hi,

 

So as you may know:

 

admin@ncs(config)# show configuration commit list 5
2018-12-20 16:32:43
SNo. ID       User       Client      Time Stamp          Label       Comment
~~~~ ~~       ~~~~       ~~~~~~      ~~~~~~~~~~          ~~~~~       ~~~~~~~
1001 10014    admin      cli         2018-12-20 16:28:48             
1001 10013    admin      cli         2018-12-20 16:28:45             
1001 10012    admin      cli         2018-12-20 16:28:43             
1001 10011    admin      cli         2018-12-20 16:28:39             
1001 10010    admin      cli         2018-12-20 16:28:35 

 

Above shows the most recent commits performed. Now, to better understand your question, are you asking for the 'rollback configuration' output for the 5 most recent rollbacks created?

 

So for example:

 

admin@ncs(config)# rollback configuration ?  
Possible completions:
  10001 - 2018-12-20 15:36:12 by system via system
  10002 - 2018-12-20 16:27:55 by admin via cli
  10003 - 2018-12-20 16:27:55 by admin via cli
  10004 - 2018-12-20 16:27:55 by admin via cli
  10005 - 2018-12-20 16:28:10 by admin via cli
  10006 - 2018-12-20 16:28:18 by admin via cli
  10007 - 2018-12-20 16:28:22 by admin via cli
  10008 - 2018-12-20 16:28:26 by admin via cli
  10009 - 2018-12-20 16:28:31 by admin via cli
  10010 - 2018-12-20 16:28:35 by admin via cli
  10011 - 2018-12-20 16:28:39 by admin via cli
  10012 - 2018-12-20 16:28:43 by admin via cli
  10013 - 2018-12-20 16:28:45 by admin via cli
  10014 - 2018-12-20 16:28:48 by admin via cli
  <cr>  - latest

 

Your desire would be 'rollback configuration list 5' as an example which in theory would show 10010-10014?

 

Hi Joey, 

 

I notice that rollback always starts with display oldest to newest, so if I [tab] or '?', it will show first 100, which I'm usually looking for last 100. I just now noticed in your post (looking at it again) that 'show configuration commit list' show most recent to oldest. I think this solves my problem, however I am curious if you know of a way to show last 100 instead of first 100 when using [tab] or '?'.

So in the ncs.conf:

/ncs\-config/rollback/history\-size (uint32) [35]

It should only save 35 rollbacks. I can’t say there is an ‘easy’ way to display the most recent to last of the 35 rollback files shown. I asked the BU for suggestions and he recommended making a clispec(5) pipeCmd that runs head(1) or write your own action that list the first number of rollback files.