Mikrotik SSH Backup - my solution

Hello All! I am created mini-tools for Mikrotik configuration backup over SSH.

One function - Backup and sending e-mail on failure. The program is written. NET.

Can run with a key “Backup” (command line, sample “MikrotikSSHBackup.exe Backup”) for background backup.
mikrotik SSH Backup.png
Download - https://dl.dropboxusercontent.com/u/10168286/Programmers/MikrotikSSHBackup.zip
GitHub - https://github.com/psionika/MikrotikSSHBackup

It will be good if somebody come in handy :slight_smile:

Very nice! Thank you!

Nice tool, thank you.

Just a small bug: If regional settings on the host computer include forward slash, the path of the backup file can not be created, since Windows doesn’t allow slash in file names.

e.g. Date setting MM/dd/yyy will try to create invalid file name “rb450, IP 192.168.1.1 02/19/2014 09-15-09.txt” and give an error message.
while yyy-MM-dd will create “rb450, IP 192.168.1.1 2014-02-19 09-15-09.txt” which is OK.
Creating/parsing your own date string is needed for portability.

FIXED: Changed in the file creation date to the substitution

DateTime.Now.ToString(CultureInfo.InvariantCulture)
                             .Replace(@"/", "-")
                             .Replace(":", "-")+".txt"

That cleared up the problem with the creation of files with different regional settings.

ADD: Editing by double-clicking on the row
ADD: Close settings and add/edit forms after press ESC
ADD: Added progressbar when working backup through the form

Download: https://dl.dropboxusercontent.com/u/10168286/Programmers/MikrotikSSHBackup.zip
GitHub - https://github.com/psionika/MikrotikSSHBackup

I’ve only been able to play with this a little, but so I love it. Thank you for putting this together! :smiley:

Thank you for the fix. This is a really nice tool.
The only thing it is missing is a restore button :laughing:

Nice tool, thanks.
I have a feature request:

  1. add ability to define port used by SSH service, currently is fixed to 22. I always use non-standard port for SSH to prevent automated port scanning.
  2. some kind of credentials encryption in ‘data.xml’ and ‘settings.xml’ files. Maybe I’m slightly paranoic :slight_smile:

Best regards,

Maybe I’m slightly paranoic > :slight_smile: >

Once you enter the world of routing & switching, you can’t help but become paranoid :open_mouth: :smiley:

  • ADD: SSH port parameter
  • ADD: Create context menu (add, copy, edit, delete)
  • ADD: Add to context menu - “Connect over winbox” (connect if the ssh user has rights to connect and winbox.exe located in the same folder as the program)
  • ADD: remove color and stateBackup after press :“Start Button”.
  • ADD: Encrypt data.xml (for command run “MikrotikSSHBackup.exe Backup YourPassword”)
  • CHANGE: Move email settings to data.xml (for Encrypt)
  • CHANGE: Remove ProgressBarForm and add progressbar in statusstrip
  • FIXED: Tab key order in AddEdit Forms

Download: https://dl.dropboxusercontent.com/u/10168286/Programmers/MikrotikSSHBackup.zip
GitHub - https://github.com/psionika/MikrotikSSHBackup

arxont, I am really very impressed with this program and with you improvements you have made with it. Thank you! Can you explain how do this:

ADD: Add to context menu - “Connect over winbox” (connect if the ssh user has rights to connect and winbox.exe located in the same folder as the program)

Nice.

@arxont
GitHub have this thing known as releases. Consider putting the binaries there… and maybe tag some versions?

Thank you for your nice tool.
If possible could you please add box to set time to launch backup

Nice tool
I have request if possible to put time box, so that I can set the time when a backup script would run

tq

Hello. No this functional.
Use standart windows Task Scheduler (or other realizations - xStarter, nnCron)

How can I run this tool? Do I need a separate piece of software to run this tool from cmd in windows?

With the binaries having gone missing on Dropbox in the decade (!) since this thread was last active, you’d have to build this C# program from the sources on GitHub, or find someone to do it for you.

Personally, I wouldn’t bother, having looked into it. This program worries me on several fronts:


  • MIA author
  • Amateurish code (mixed GUI and logic, misapplication of obsolete crypto class, etc.)
  • Compiled DLLs distributed with project without provenance given
  • No license given

Short of a detailed code review, I wouldn’t dare run a binary built from this code even if it were available.

For roughly the same cost as downloading a copy of Visual Studio Community needed to build this — if indeed it even will build out of the box a decade later — you could install WSL and my backup solution, which doesn’t have any of the above-listed weaknesses. It hasn’t got a GUI for doing the backup, but the Fossil piece gives you a GUI for managing the backup snapshots taken afterward.

(Personally, I consider that a strength. This separates core logic from the peripheral GUI elements, as is proper.)

I’ve got a separate thread dedicated to that tool here.