Skip to main content

RouterOS config backup tool

Project description

ROSBackup

Summary

Simple utility for backing up RouterOS configuration.

Installation

Create backup user account

It is recommended to create a dedicated user account with limited permissions for backup purposes. This user should have ssh and read permissions. Please check RouterOs manual if you are not sure how to do this.

Installation form PyPI:

pip3 install rosbackup

Docker

You can download the image from Docker Hub:

docker pull mharjac/rosbackup

Or build it on your own:

docker build -t rosbackup . -f docker/Dockerfile

Create a volume for storing backups:

docker volume create mikrotik-router-1

Create a container:

docker run -d --name=mikrotik-router-1 -e ROS_HOST="https://192.168.1.1" -e ROS_USER="backusr" -e ROS_PASS="somesuperstrongpassword" --mount=src=mikrotik-router-1,dst=/backup rosbackup:latest

And finally, for unattended regular backups, create a cron job which will execute:

docker start mikrotik-router-1

Install from Snap Store

snap install rosbackup

Usage

It can be used as an interactive tool from CLI:

rosbackup -H https://192.168.1.1 -u user1 -p passw0rd -f ./backup.cfg

When used in CLI, it will prompt for password if -p (--password) flag is not provided. Also, without -f (--file) flag, config will be printed to the stdout.

It can also be used for unattended backups (e.g., in containers), in which case, it requires following environment variables:

  • ROS_HOST: for storing IP address or hostname (e.g., 192.168.1.1)
  • ROS_USER: username for making backups
  • ROS_PASS: password for provided username
  • ROS_DELAY: execution delay between commands (optional; required on older devices; default 5)
export ROS_HOST="192.168.1.1" ROS_USER="user1" ROS_PASS="passw0rd" ROS_DELAY="3"
rosbackup

When executed in unattended mode, configuration backup will be saved in execution directory as config-{time_stamp}.cfg.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rosbackup-1.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

rosbackup-1.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file rosbackup-1.1.0.tar.gz.

File metadata

  • Download URL: rosbackup-1.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5rc1

File hashes

Hashes for rosbackup-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f14c94d1808d3be050d406905976b5d1d1be93689a8c354fca97962da1f4d705
MD5 fcce030ddae79b489f8ed4df63940017
BLAKE2b-256 ba22454aea52020d174cfc7aefd3d905514849cae1717a894add0d54bb9cd91c

See more details on using hashes here.

File details

Details for the file rosbackup-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: rosbackup-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5rc1

File hashes

Hashes for rosbackup-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7301458c276caa3e37118a7cdd7c6f492b02784bd21e11f1eb85d072c868f9cf
MD5 a971d8ebec19b2f95491cb511cea2cdd
BLAKE2b-256 e273c7c42f6faa5102c372ec37c4e3bd4e606890f7f2fdab8f66c414eca27009

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page