Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xpyctiks/mikrotik-backups.py
Python script for automatic backups of any Mikrotik device. Supports file backups: plain and encrypted. Cloud backup. UserManager backup.
https://github.com/xpyctiks/mikrotik-backups.py
backup linux mikrotik python3 usermanager
Last synced: 7 days ago
JSON representation
Python script for automatic backups of any Mikrotik device. Supports file backups: plain and encrypted. Cloud backup. UserManager backup.
- Host: GitHub
- URL: https://github.com/xpyctiks/mikrotik-backups.py
- Owner: Xpyctiks
- License: unlicense
- Created: 2025-02-03T16:03:07.000Z (9 days ago)
- Default Branch: main
- Last Pushed: 2025-02-04T15:55:16.000Z (8 days ago)
- Last Synced: 2025-02-04T16:41:35.358Z (8 days ago)
- Topics: backup, linux, mikrotik, python3, usermanager
- Language: Python
- Homepage: https://xpyct.com
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mikrotik-Backups.py
This is a new version of my old bash script written in python, which makes backups of Mikrotik devices and downloads them to any local folder.
Allows creation of:
- plaintext + full encrypted backups.
- cloud backup in Mikortik cloud.
- backup of UserManager database.
- Flush of UM sessions after backup.
Also the script sends all important alerts and information to Telegram bot + full logging into local file.Requires additionally two python packages:
- paramiko
- requestsInstallation:
- Just download the script to any folder. For example, on Debian-based OS it could be /usr/local/bin/ folder.
- Launch the script from CLI for the first time. It will generate a default configuration file.
- Modify the config. file:
"telegramToken" and "telegramChat" - fill in to get Telegram notifications work
"logFile" - Path and name of the log file. Default right in the script's folder with script's name.
"backupFolder" - Root backup folder, inside of which all other folder will be made. Every folder with backups has a name as current date.
"backupEncryptPass" - the password you want to set for cloud backup and file backups for Mikrotik.
"BackupList" - General branch where all devices for backup are described:
"Name" - Name of the device as you want to see it.Used to easy identificate your device.You can set anything you want.
"Host" - FQDN or IP of the device.
"Password", "Port","keyFile" - general options. If both Password and KeyFile are set - keyFile auth will be choosen as the higher priority.
You can set only Password variable if need password auth, or keyfile - if key file auth.
"cloudBackup" - if True - also create a backup in Mikrotik cloud.
"UserManager" - if True - also create a backup of UserManager database files.
"cleanUMsessions" - if True - clear all current sessions in UM.