What about when you have different interfaces or something dynamic matching a fw-rule?
Lets say I need to restore a Hex that uses a USB-LTE-modem, if I do not have the modem plugged in when doing /import it will fail with "input does not match any value of interface" because "LTE1" interface do not exist yet.
Automate ".backup" files?
Few possibilities here:
1) if the new device is supposed to have the LTE modem even after restore - simply plug it in before import
2) if the new device is not supposed to have LTE, you can just search the config for "lte1" and remove the lines referencing it
3) if the new device is supposed to have LTE, but you can't plug it in now, you can search for "lte1" lines, and cut them out
after the device is put in place and LTE reconnected, just paste those remaining lines into the CLI
If you want to completely automate option 3, you can put those lines into a file.
Create a scheduled script which will run on next boot that will import that file.
After that the script should delete the file, and delete the schedule.
Of course, connect the LTE modem before the boot.
1) if the new device is supposed to have the LTE modem even after restore - simply plug it in before import
2) if the new device is not supposed to have LTE, you can just search the config for "lte1" and remove the lines referencing it
3) if the new device is supposed to have LTE, but you can't plug it in now, you can search for "lte1" lines, and cut them out
after the device is put in place and LTE reconnected, just paste those remaining lines into the CLI
If you want to completely automate option 3, you can put those lines into a file.
Create a scheduled script which will run on next boot that will import that file.
After that the script should delete the file, and delete the schedule.
Of course, connect the LTE modem before the boot.
Hey now,
Bit of an old thread but relevant nonetheless.
I understand all the comments and arguments laid out so far Tomas but still I'd like the ability to take a binary blob backups (.backup).
Not for the reasons given so far. I want it because I want to automate updating Mikrotik packages and firmwares.
If an update goes "sideways", I can use the .backup file to restore - with credentials, certificates, etc.
This is of course back onto the same hardware so there should be no issues or concerns.
I don't necessarily need it as part of the routine/nightly automated backups but I DO need to be able to do it from the scripts (Mass config push).
I mean I can TAKE the .backup now, I just don't know how I'd retrieve it to Unimus.
I thought about emailing the backup but that is messy. If a smtp server breaks, changes, malfunctions at the time, whatever, I have no blob. And since this is infrequently used, more chance something goes wrong and is unnoticed.
No, I need a way to have Unimus either take the .backup for me (on demand) or a way to have Unimus simply retrieve a file from the 'tik filesystem (on demand).
Thoughts?
Please. Thanks.
J.
Bit of an old thread but relevant nonetheless.
I understand all the comments and arguments laid out so far Tomas but still I'd like the ability to take a binary blob backups (.backup).
Not for the reasons given so far. I want it because I want to automate updating Mikrotik packages and firmwares.
If an update goes "sideways", I can use the .backup file to restore - with credentials, certificates, etc.
This is of course back onto the same hardware so there should be no issues or concerns.
I don't necessarily need it as part of the routine/nightly automated backups but I DO need to be able to do it from the scripts (Mass config push).
I mean I can TAKE the .backup now, I just don't know how I'd retrieve it to Unimus.
I thought about emailing the backup but that is messy. If a smtp server breaks, changes, malfunctions at the time, whatever, I have no blob. And since this is infrequently used, more chance something goes wrong and is unnoticed.
No, I need a way to have Unimus either take the .backup for me (on demand) or a way to have Unimus simply retrieve a file from the 'tik filesystem (on demand).
Thoughts?
Please. Thanks.
J.
In Unimus 2.0.0, we are adding an API endpoint for pushing backups into Unimus.
This endpoint will support binary backups (as well as text backups of course).
You will be able to use the integrated MikroTik "fetch" tool to push a .backup file into Unimus from a Mass Config Push preset using this.
That sounds *awesome*Tomas wrote: ↑Thu Aug 29, 2019 7:07 am
In Unimus 2.0.0, we are adding an API endpoint for pushing backups into Unimus.
This endpoint will support binary backups (as well as text backups of course).
You will be able to use the integrated MikroTik "fetch" tool to push a .backup file into Unimus from a Mass Config Push preset using this.
Do we have an ETA on 2.0.0?
Thanks Tomas.
Do you have an example how to push (with fetch command) a .backup from a mikrotik device?Tomas wrote: ↑Thu Aug 29, 2019 7:07 amIn Unimus 2.0.0, we are adding an API endpoint for pushing backups into Unimus.
This endpoint will support binary backups (as well as text backups of course).
You will be able to use the integrated MikroTik "fetch" tool to push a .backup file into Unimus from a Mass Config Push preset using this.
Hello.
Anybody successful configure Mikrotik device to send BINARY type config with api to Unimus?
I tried with:
I get success in mikrotik terminal, but it doesnt send a file. I think this command send the string "file.backup" not the contents.
And in the result i get backup Binary in unimus but the file size is 16b and should be 417KB.
Additionaly mikrotik download file with name "backups"
From mikrotik forum i read that http method cant upload file, only sftp and ftp can do it.
Some can help ?
Maybe @Tomas ?
We are planning mass deployment of this software to over 300 devices.
Best Regards.
Anybody successful configure Mikrotik device to send BINARY type config with api to Unimus?
I tried with:
Code: Select all
/tool fetch http-method=post http-header-field="accept:application/json,content-type:application/json,Authorization:Bearer sfjhasdbfhjasdfjhsadfgjsagsdfhjsdfhasdfghsd" http-data="{\"backup\":\"file.backup\",\"type\":\"BINARY\"}" url="http://ipadress:8085/api/v2/devices/1/backups"
And in the result i get backup Binary in unimus but the file size is 16b and should be 417KB.
Additionaly mikrotik download file with name "backups"
From mikrotik forum i read that http method cant upload file, only sftp and ftp can do it.
Some can help ?
Maybe @Tomas ?
We are planning mass deployment of this software to over 300 devices.
Best Regards.
You provided a valid JSON string, but you actually didn't include a file.backup's content, just sent "file.backup" as the string instead.bkopec wrote: ↑Thu Jan 21, 2021 1:34 pmHello.
Anybody successful configure Mikrotik device to send BINARY type config with api to Unimus?
I tried with:I get success in mikrotik terminal, but it doesnt send a file. I think this command send the string "file.backup" not the contents.Code: Select all
/tool fetch http-method=post http-header-field="accept:application/json,content-type:application/json,Authorization:Bearer sfjhasdbfhjasdfjhsadfgjsagsdfhjsdfhasdfghsd" http-data="{\"backup\":\"file.backup\",\"type\":\"BINARY\"}" url="http://ipadress:8085/api/v2/devices/1/backups"
And in the result i get backup Binary in unimus but the file size is 16b and should be 417KB.
Additionaly mikrotik download file with name "backups"
From mikrotik forum i read that http method cant upload file, only sftp and ftp can do it.
Some can help ?
Maybe @Tomas ?
We are planning mass deployment of this software to over 300 devices.
Best Regards.
Can you try:
Code: Select all
http-data="{\"backup\":\""+file.backup+"\",\"type\":\"BINARY\"}"