Skip to content

Instantly share code, notes, and snippets.

View ilevennet's full-sized avatar

Ileven.net ilevennet

View GitHub Profile
@ilevennet
ilevennet / AmazonLinux-InstallPostGIS.sh
Last active May 18, 2023 15:15 — forked from ATran31/AmazonLinux-InstallPostGIS.sh
Script to install PostgreSQL 10 and PostGIS 2.5 on fresh Amazon Linux 2
#!/bin/bash
# Script to install PostgreSQL 10 and PostGIS 2.5 on Debian 11
# Installing from source:
# - GEOS 3.9.4
# - GDAL 2.4.0
# - PostGIS 2.5.1
set -e
@ilevennet
ilevennet / restore-mariadb.sh
Created January 18, 2023 13:56 — forked from BlackCounter/restore-mariadb.sh
restore mariadb
#!/usr/bin/env bash -x
# OSX: execute as user
# Linux: execute as root
MY_DIR=$(cd $(dirname ${BASH_SOURCE[0]});pwd)
cd $MY_DIR
MARIABACKUP=$(which mariabackup)
@ilevennet
ilevennet / README.md
Last active January 18, 2023 10:24 — forked from albrecht-net/README.md
MariaDB - Mariabackup wrapper script

Preperation

  1. Install mariadb-backup and rsync on your database server.
  2. Download both shell scripts from the github gist and place them for example your users home folder on the database server.
  3. Create a folder which is used, to temporary store the backup data and enter the full path in both scripts to the enviroment variable BACKUP_DIR (default is /var/mariadb/backup).
  4. Create a folder (or mount point) where the backup files should get moved. At its best, this folder points to a remote location to store your backups not on the same machine/vm. Enter the full path in both scripts to the enviroment variable BACKUP_FILE_DEST (default is /mnt/backup-database).
  5. Change the enviroment variable TARGET_NAME_PREFIX in both scripts if you use these scripts for more then one backup task (more on this later).
  6. Create a user on your database server and grant the following privileges [1] to all databases if you have MariaDB >v10.5: RELOAD, PROCESS, LOCK TABLES, BINLOG MONITOR. You should only allow the us