Skip to content

Instantly share code, notes, and snippets.

@instantdreams
instantdreams / .env.example
Created January 6, 2022 23:46
Example .env file for NPM backup and restore scripts - use cp .env.example .env and then edit to match your system settings
#!/bin/bash
# Script location : /srv/bin/config.sh
npm_db_name=[npm database container name] # Usually nginx-proxy-manager_db_1
mysql_user=[mysql username] # Usually npm
mysql_pass=[mysql password] # Usually npm and set in /srv/nginx-proxy-manager/.env.example
mysql_db=[mysql database] # Usually npm
@instantdreams
instantdreams / npm_backup.sh
Created January 6, 2022 23:44
Backup entire NPM configuration to a set location
#!/bin/bash
# Script location : /srv/bin/npm_backup.sh
# npm_home : Location of nginx-proxy-manager installation
# backup_target : Folder name for backup
npm_home=/srv/nginx-proxy-manager
backup_target=/media/Backups/nginx-proxy-manager
# Import protected variables
source /srv/bin/.env
# Create Backup
@instantdreams
instantdreams / npm_restore.sh
Last active October 23, 2022 02:51
Restore NPM configuration from previously created backup
#!/bin/bash
# Script location : /srv/bin/npm_restore.sh
# restore_source : Folder name for restore
# npm_home : Location of nginx-proxy-manager installation
restore_source=/media/Backups/nginx-proxy-manager
npm_home=/srv/nginx-proxy-manager
# Import protected variables
source /srv/bin/.env
# Restore Items