Backup configuration in plaintext?

I have automated a backup using ‘expect’ on linux. Essentially, a script logs in, runs /export and records the output. Although pretty in the Mikrotik shell, the config is riven with carriage returns and formatting markup e.g. m35m, m35; ^[[m etcetera. Some of this cannot be regexed away. Is there a way to pull a plain text backup out of RouterOS?

Hi… it’s “like” you did.. more or less:


/export file=blabla

If you look in /files menu you have a .rsc file that is a txt.. : P!

If you’re going to put it on another router, I would add the compact command in there as well.

/export file=backup-test compact

Thanks, that did it for me.

The .backup files are binary but only generated when using winbox it seems. The .rsc files are just what I wanted. ‘compact’ doesn’t seem available on 4.11 however.

using expect/send and wget, I’ve got an automated backup running against a few routerboards.

Cheers!


I had problems with the compact.. Sometimes makes a bad export not taking all “nomdefault” parameters.. I didnt have time to look for version/board..!

I’ll have to keep that in mind…it hasn’t given me any problems yet but i’ll look for that if I do. Thanks!