Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MikroTik Backup Tool

This is a scipt which create backups from a mikrotik device by connecting to it via SSH, and copying over the created backup to a server.

It has implemented backup retention divided into:

  • hourly
  • daily
  • weekly
  • monthly

it's supposed to be run in the background, so it's best if it's envoked at startup. The script itself has fields which have to be filled in order for the script to work.


Configuration

  1. Generate ssh key-pair
ssh-keygen -t ed25519 -N "" -f private.key
  1. Adjust environmental variables in config.env according to your needs:
ROUTER_USERNAME=admin
PRIVATE_KEY_PATH=private.key
ROUTER_HOSTNAME=198.168.88.1
ROUTER=MikroTik

In mikrotik device settings create user ex. backup with full permissions and import your public ssh key to it.

How to run

Locally

  1. Source your adjusted config.env
set -o
source config.env
set +o
  1. Execute script
./mikrotik-backup-tool.sh

With docker

docker run \
--rm \
--env-file config.env \
-v ~/private.key:/opt/private.key:ro \
-v ./backups/:/opt/backups/ \
mikrotik-backup-tool:latest

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages