Skip to content

Local-Connectivity-Lab/scn-librenms-backup-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Backs up librenms to azure. It is meant to run from the librenms server. Currently the sh script runs on ash, I did not try it on bash

Running

example: WEBHOOK_URL_FILE=<webhook_url_file> SAS_TOKEN_FILE=<token_file> SQL_PASSWORD_FILE=<password_file> /path/to/backup.sh >> /var/log/librenms_backup.log 2>&1

  • Set WEBHOOK_URL_FILE to the path of a file containing the discord webhook url to report backup status
  • Set SAS_TOKEN_FILE to the path of a file containing the sas token of the credentials you are using to upload to azure
  • Set SQL_PASSWORD_FILE to the path of a file containing the password of the mariadb database. It is in vaultwarden

You also need to add the backup_compose.yml to the same compose directory as the compose.yml for the service for this to work.

Getting a SAS token

For the SAS token, I got it by going to the scnbackups storage account, in the left pannel under Security + networking go to Shared access signature link. There you can create a shared access signature.

  • For Allowed services you only need to have Blob checked
  • For the Allowed resource types you just need to select object
  • For the Allowed permissions you need to put Write and Create
  • For Blob versioning permissions you can put that as unchecked
  • For Allowed blob index permissions you just need to check Read/Write and leave Filter unchecked
  • Set the expiration date and time to some time you are comfortable with and create a new one when it expires. Just make sure to take note of the expiration date because I dont think you can get it back after you go to another screen
  • For allowed IPs, if you know the IP it is coming from I guess you can set it but I did not know so I did not set it

When you generate it there is a field called SAS token. Copy that one.

About

backs up librenms to azure blob store

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages