Community discussions

MikroTik App
 
arxont
just joined
Topic Author
Posts: 9
Joined: Fri Nov 02, 2012 11:45 am

Mikrotik SSH Backup - my solution

Wed Oct 09, 2013 4:42 pm

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/101 ... Backup.zip
GitHub - https://github.com/psionika/MikrotikSSHBackup

It will be good if somebody come in handy :)
You do not have the required permissions to view the files attached to this post.
 
User avatar
rickfrey
Trainer
Trainer
Posts: 609
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Mikrotik SSH Backup - my solution

Mon Feb 17, 2014 8:09 am

Very nice! Thank you!
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: Mikrotik SSH Backup - my solution

Wed Feb 19, 2014 9:21 am

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.
 
arxont
just joined
Topic Author
Posts: 9
Joined: Fri Nov 02, 2012 11:45 am

Re: Mikrotik SSH Backup - my solution

Wed Feb 19, 2014 3:34 pm

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/101 ... Backup.zip
GitHub - https://github.com/psionika/MikrotikSSHBackup
 
User avatar
rickfrey
Trainer
Trainer
Posts: 609
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Mikrotik SSH Backup - my solution

Wed Feb 19, 2014 5:41 pm

I've only been able to play with this a little, but so I love it. Thank you for putting this together! :D
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: Mikrotik SSH Backup - my solution

Wed Feb 19, 2014 6:39 pm

Thank you for the fix. This is a really nice tool.
The only thing it is missing is a restore button :lol:
 
ditonet
Forum Veteran
Forum Veteran
Posts: 835
Joined: Mon Oct 19, 2009 12:52 am
Location: Europe/Poland/Konstancin-Jeziorna
Contact:

Re: Mikrotik SSH Backup - my solution

Thu Feb 20, 2014 12:17 am

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 :)

Best regards,
 
User avatar
rickfrey
Trainer
Trainer
Posts: 609
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Mikrotik SSH Backup - my solution

Thu Feb 20, 2014 5:07 am

Maybe I'm slightly paranoic :)
Once you enter the world of routing & switching, you can't help but become paranoid :shock: :D
 
arxont
just joined
Topic Author
Posts: 9
Joined: Fri Nov 02, 2012 11:45 am

Re: Mikrotik SSH Backup - my solution

Thu Feb 20, 2014 3:15 pm

  • 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/101 ... Backup.zip
GitHub - https://github.com/psionika/MikrotikSSHBackup
 
User avatar
rickfrey
Trainer
Trainer
Posts: 609
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Mikrotik SSH Backup - my solution

Thu Feb 20, 2014 5:01 pm

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)
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Mikrotik SSH Backup - my solution

Thu Feb 20, 2014 6:28 pm

Nice.

@arxont
GitHub have this thing known as releases. Consider putting the binaries there... and maybe tag some versions?
 
nbctcp
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Tue Sep 16, 2014 7:32 pm

Re: Mikrotik SSH Backup - my solution

Wed Sep 24, 2014 4:10 am

Thank you for your nice tool.
If possible could you please add box to set time to launch backup
 
nbctcp
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Tue Sep 16, 2014 7:32 pm

Re: Mikrotik SSH Backup - my solution

Wed Sep 24, 2014 4:12 am

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
 
arxont
just joined
Topic Author
Posts: 9
Joined: Fri Nov 02, 2012 11:45 am

Re: Mikrotik SSH Backup - my solution

Sun Oct 26, 2014 5:13 am

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)
 
rober
just joined
Posts: 1
Joined: Mon Jan 29, 2024 2:26 pm

Re: Mikrotik SSH Backup - my solution

Wed Mar 06, 2024 3:06 pm

How can I run this tool? Do I need a separate piece of software to run this tool from cmd in windows?
Last edited by tangent on Wed Mar 06, 2024 5:37 pm, edited 1 time in total.
Reason: Merged two back-to-back posts; fixed grammar
 
tangent
Forum Guru
Forum Guru
Posts: 1406
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: Mikrotik SSH Backup - my solution

Wed Mar 06, 2024 6:09 pm

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.

Who is online

Users browsing this forum: Semrush [Bot] and 3 guests