Community discussions

MikroTik App
 
venustech
just joined
Topic Author
Posts: 2
Joined: Fri Aug 10, 2012 7:02 pm

Backup configuration in plaintext?

Fri Aug 10, 2012 7:06 pm

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?
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Backup configuration in plaintext?

Tue Aug 21, 2012 9:45 am

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!
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: Backup configuration in plaintext?

Tue Aug 21, 2012 7:00 pm

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
 
venustech
just joined
Topic Author
Posts: 2
Joined: Fri Aug 10, 2012 7:02 pm

Re: Backup configuration in plaintext?

Tue Aug 21, 2012 8:55 pm

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!

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
 
User avatar
Ibersystems
Forum Guru
Forum Guru
Posts: 1686
Joined: Wed Apr 12, 2006 12:29 am
Location: Cabrils, Barcelona - Spain
Contact:

Re: Backup configuration in plaintext?

Tue Aug 21, 2012 9:12 pm

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..!
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: Backup configuration in plaintext?

Wed Aug 22, 2012 2:03 am

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!

Who is online

Users browsing this forum: GoogleOther [Bot], McSee, unhuzpt and 105 guests