A bash script used to access the OPNsense API remotely to backup the configuration.
OPNSense os-api-backup is not needed since Update 23.7.8.
A Remote system for running the script and saving the output.
(Iam using Debian for example, curl needs to be installed)
Create OPNSense API Key and set permissions
Install the dependencies for debian to run the script
$ sudo apt install curl
Make the script executable
$ sudo chmod u+x /*pathtobackupscript*/opnsense-backup.sh
Execute the script through crontab, in the example at 1 in the morning
$ sudo crontab -e
0 1 * * * /*pathtobackupscript*/opnsense-backup.sh
https://docs.opnsense.org/development/how-tos/api.html
https://docs.opnsense.org/development/api/core/firewall.html
This repository is for educational and informational purposes only.
The author assumes no liability for any damages that may arise from the use of the contents of this repository.
Contributions are always welcome! If you find an error or would like to suggest an improvement, please create an issue.