I use this feature when carefully rolling out a new RouterOS version, since it gives me a diff between the old configuration and the upgraded one. You can pass one or more hostnames or IPs after the initial setup, in which case what you get is a limited backup of only the named hosts. If that bothers you, change the " fossil ci" line near the end, passing a canned or computed message via the -m flag. This step does mean the script isn't suited to automated backups. Tell Fossil about that by setting the EDITOR environment variable appropriately. I find it easiest to compose that comment inside my favorite text editor. updated the firewall rules to block $VULN_DU_JOUR.enabled WireGuard on the border gateway.This eases historical exploration, as when you're trying to find out why a given setting changed. It iterates over the per-host subdirectory names it finds in $bdir, updates them with fresh backups, and commits any substantial changes it finds to $repo.įor each backup past the initial one, it asks you to give a commit comment, which lets you document the reason for the backup. Once the backup environment is set up, you can simply run this script without arguments each time you want another backup taken. The final step will do the initial backup on those boxes, storing them initially in $bdir, then atomically committing that first set of backups durably to $repo. Run the script once by hand, passing the hostnames or IPs of the RouterOS boxes you want it to back up. Contrast it with the repository, which stores all historical versions the local check-out is a changeable view into the repository. Wherever you want the current versions of your backups on your local machine, that's where you should point this script. They're separate because you may have other Fossil repos under that directory this script deals with just that one repo.īdir is where your local check-out of the backup repository lives. Repo is the name of the actual Fossil repository under $rdir where you want your backups stored. The default is " ~/museum", being a place where one stores precious Fossils, but you are free to use anything else you like. Set up SSH on each RouterOS box you want backed up, with host keys for automated login.Īdjust the user-configurable variables at the top of the script: You can download the latest version of the script here.Īlternately, you may wish to maintain a local fork of this repository so you can manage your local modifications without needing to overwrite them each time this script changes. You might find that you enjoy Fossil for the same reasons you enjoy RouterOS. Fans of other VCSes are encouraged to give the script a try as-is before going in and hacking it to use your current VCS of choice. The Fossil version control system is designed with the same sensibility as RouterOS: self-contained, featureful, compact, and coherent. There may be third-party SSH command line implementations that use the same command formats this script relies on, but no attempt has been made to verify this. OpenSSH is installed by default on virtually every Linux and macOS system, and it's a first-party add-on from Microsoft for modern Windows versions. The script was written for systems with the OpenSSH commands in mind. It can be made to run on modern Windows systems via WSL, or on legacy Windows systems via Cygwin. It was written for and tested on a macOS system, but it should run just as well on Linux. It relies on other POSIX user environment stuff: cut, grep, tail, etc. The script was written and tested under Bash, though it should be portable to any other POSIX shell, needing only a change to the shebang line. That means you can get a web view of your RouterOS backups using the Files interface above, browse the history of your backups, get graphical diffs between versions of your backups, download Zip archives of your latest backups, and more. The script uses SSH to create and pull the backup files, which it then stores in Fossil, the version control system backing this very web site. There are many solutions for backing up RouterOS devices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |