Community discussions

MikroTik App
 
Grumpy
just joined
Topic Author
Posts: 13
Joined: Mon Sep 11, 2023 9:06 am

Diff configurations or configuration history?

Sat Apr 20, 2024 12:32 pm

I know about the supout.rif and about to diff files but I'm looking for a more convenient way to see my latest config changes. Is there a kind of history available?
Last edited by Grumpy on Sat Apr 20, 2024 1:03 pm, edited 1 time in total.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11702
Joined: Thu Mar 03, 2016 10:23 pm

Re: Diff configurations or configuration history?

Sat Apr 20, 2024 12:51 pm

The only history (and not really complete) is in logs ... until they persist. What many people do is they periodically create textual export and store them somwhere off device and use appropriate tool to compare different export files. One can use git to store files and use built-in tools to see difference. One can store files in flat file system and use some programmer editor or linux diff command to see differences. Etc.
Last edited by mkx on Sun Apr 21, 2024 1:31 pm, edited 1 time in total.
 
IlKa
newbie
Posts: 34
Joined: Sun Jan 03, 2021 11:42 pm

Re: Diff configurations or configuration history?

Sat Apr 20, 2024 9:13 pm

Our routers backup config as text script
/system/backup/save dont-encrypt=yes name=myrouter42
/export file=myrouter42.rsc
this file is available via TFTP from one particular IP

And there is a Linux server that fetches this file every midnight via cron. And then it adds it to git and commits. Git repo then pushed to remote server.
We use it for backups. But git can also show you diff between any two revisions. It can even bisect and grep through changes etc.
Git shows diff in pseudographics by default (I guess it uses `diff(1)`, but it can use any external graphical tool).

I suggest to store configuration, docs, scripts etc in text format in some version control system if possible. Treating configuration as code is a good thing, and diff comes for free
 
Grumpy
just joined
Topic Author
Posts: 13
Joined: Mon Sep 11, 2023 9:06 am

Re: Diff configurations or configuration history?

Sun Apr 21, 2024 12:57 pm

thx, nice!

Who is online

Users browsing this forum: broderick and 36 guests