1
Tutorials and FAQs / Re: Automatic config backups using os-api-backup
« on: April 05, 2023, 09:02:31 pm »I took your script as an example and created a version which also encrypts the backups using GPG.
You can find the script here:
https://codeberg.org/SWEETGOOD/andersgood-opnsense-scripts/src/branch/main/backup-opnsense-via-api.sh
I also wrote a short blogpost in German with some explanations:
https://andersgood.de/kurz-notiert/opnsense-per-api-verschluesseltes-backup-der-konfiguration-anlegen
Thanks to the TS for your work!
Nice script, a minor improvement would be to change the date command output to include hour and minute. This makes it possible to run the backup multiple times a day.
$(date +%Y-%m-%d-%H:%M)
Also, at the end the clean up is a bit dangerous. If you by accident put the backup files in your home or in / the outcome is terrible