BAckup file naming

It would ne good to have MT name backup files using system identification. I fone maintains several MT boxes it is complicated to keep backups if they all have similar names looking like MikroTik+DateTime.

Naming scheme could be Mikrotik + SystemIdentity +DateTime.

if you use the full command you can name the file anything you want.

system backup save name=name.bak

thanks

That is ok, but I still think default naming scheme should be such that they are unique per MT host. That would make autoamting backups much easier.

Also I notuiced that date part ov file name uses ddmmyyyy format. It would be better to be yyyymmdd to be easily sorted by date.

Not exactly “default”, but you can do some nice things with scripts:

:local NAME [/sys identity get name]
:local TIME [/sys clock get time]
:local DATE [/sys clock get date]

:local MO [:pick $DATE 0 3]
:local DY [:pick $DATE 4 6]
:local YR [:pick $DATE 7 11]
:set DATE ($YR . "-" . $MO . "-" . $DY)

/system backup save name=($NAME . "_" . $DATE . "_" . $TIME . ".backup" )

Season to taste,
–Eric

Just gotta say that is simple and sweet!

Mike

This looks like going downtown using airplane :slight_smile:
And it does not work what I suggested.

why not? i think it does exactly what you asked …

Month is not a number, so sorting by name, would not order files by creation date and time.

Point of my idea is that it is logical to name files in that manner that they can be sorted out by creation date and time regardles file date and time (when you download backup files to other computer, creation date and time are changed, but file name is not.

It is matter of usability, what is most useful, should be default.

Personally, I think the default is most useful.

When the backup collector grabs the file via scp, it has a predictable name.

But, if you want:

:local NAME [/sys identity get name] 
:local TIME [/sys clock get time] 
:local DATE [/sys clock get date] 

:local NUMMO ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec")

:local MO ( [:find $NUMMO [:pick $DATE 0 3] ] + 1 )

:local DY [:pick $DATE 4 6] 
:local YR [:pick $DATE 7 11] 
:set DATE ($YR . "-" . $MO . "-" . $DY) 

/system backup save name=($NAME . "_" . $DATE . "_" . $TIME . ".backup" )

–Eric

Ok, I give up. I did not ask how to do it, but asked it to be simplified.