1. ai autopostgresqlbackup
  2. dpkg -L autopostgresqlbackup
  3. mkdir /var/backups/autopostgresqlbackup
  4. vim /etc/default/autopostgresqlbackup
  5. /usr/sbin/autopostgresqlbackup
  6. l /var/backups/autopostgresqlbackup/*/*

PeerTube

  1. https://docs.joinpeertube.org/maintain/migration 
  2. vim $(which autopostgresqlbackup) +361 #367
    • su $SU_USERNAME -l -c "pg_dump -Fc $PGHOST $OPT $db -f $2"
    • pg_dump -Fc --username=$USERNAME $PGHOST $OPT $db -f $2
#!/bin/zsh
# Script Version: 02
# Description: List available Borg backups in the specified repository

# Set variables
# ========
REPO1="ssh://"
BORG_PASSPHRASE_FILE="/root/.borg_passphrase"

# Functions
# ========
log_message() {
    echo "$(date +"%Y-%m-%d %H:%M:%S") - $1"
}

# Main Process
# ========
log_message "Listing available backups in repository."

# Ensure Borg passphrase file is available
if [ -f "$BORG_PASSPHRASE_FILE" ]; then
    export BORG_PASSPHRASE=$(<"$BORG_PASSPHRASE_FILE")
else
    log_message "Borg passphrase file not found."
    
Tags
#!/bin/sh
# Version: 1.2
# Description: Automates Borg backup process with logging, error handling,
#              and repository initialization if required.

set -e

# =============================================================================
# Configuration
# =============================================================================

# Hostname setup
FULL_HOSTNAME=$(hostname)
SHORT_HOSTNAME=$(hostname -s)

# Passphrase file
BORG_PASSPHRASE_FILE=~/.borg_passphrase

# SSH key file location
SSH_KEY="/root/.ssh/id_ed25519_$SHORT_HOSTNAME"

# Backup ser
Tags
#!/bin/bash
# Version: 1.0
# Description: This script lists all the archives in a Borg repository

set -euo pipefail

# Check if whiptail is installed
if ! command -v whiptail &> /dev/null; then
  echo "whiptail is required but not installed.
Tags
#!/bin/bash
# v01

# List and check LXC containers
echo "Listing all LXC containers..."
CONTAINERS=($(lxc-ls -1))

# Check if there are any containers
if [[ ${#CONTAINERS[@]} -eq 0 ]]; then
    echo "There are no LXC containers."
    exit 1
fi

echo "Found ${#CONTAINERS[@]} container(s): ${CONTAINERS[@]}"
echo "----------------------------------"

# Loop over each container
for LXCHOSTNAME in "${CONTAINERS[@]}"; do
    echo "Processing container: $LXCHOSTNAME"

    # Stop the container
    echo "Stopping container $LXCHOSTNAME..."
    if !

rsnapshot.conf - no SPACES only TABS!  

Tags
#!/bin/bash
# Script Version: 1.0
# Description: This script searches through BorgBackup archives for files matching a specific pattern.

set -euo pipefail

# Variables
HOSTNAME=$(hostname)
BORG_PASSPHRASE_FILE="$HOME/.borg_passphrase"
SSH_KEY="/root/.ssh/id_ed25519_$HOSTNAME"
REPO1=".at:/./borg"
LOG="/var/log/borg_find.log"
PATTERN="${1:-}" # File pattern to search for (provided as the first argument)

# Load Borg passphrase
if [ -f "$BORG_PASSPHRASE_FILE" ]; then
  export BORG_PASSPHRASE=$(cat "$BORG_PASSPHRASE_FILE")
else
  echo "Passphrase file not fou
Tags
#!/bin/sh
# =============================================================================
# Script Name: borg_backup_hetzner.sh
# Version: 1.2
# Author: Andreas Fleckl
# Description: This script performs backups using Borg to a Hetzner Storage Box.
#              It reads directories to backup and exclude from specified files,
#              handles logging, performs pruning of old backups, and sends
#              notifications about the backup status.
# =============================================================================

# Backup repository loc
Tags
  1. https://torsion.org
  2. ai borgbackup borgmatic pwgen
  3. pwgen -1cns 32

init

  1. borg init --encryption=repokey borg@BSIP:/home/borg/$HOST
  2. borg key export

Change the Passphrase

  1. export BORG_REPO="ssh://borg@BSIP/home/borg/$HOST"
  2. borg key change-passphrase

ssh keys

  1. ssh-keygen -t ed25519 
  2. ssh-copy-id -i .ssh/id_ed25519.pub borg@BSIP
  3. chmod 600 .ssh/id_ed25519
  4. eval "$(ssh-agent -s)"
Tags
  1. ai automysqlbackup
  2. vim /etc/default/automysqlbackup
    1. BACKUPDIR="/var/backups/automysqlbackup"
    2. mkdir /var/backups/automysqlbackup
    3. /etc/cron.daily/automysqlbackup
    4. l /var/backups/automysqlbackup/daily/*/
  3. omz plugin info extract

restore

  1. unpack /var/backups/automysqlbackup/INTERVAL/DB-NAME/DB_INTERVAL_DATE.sql.COMPRESSION
    • bzip2 -dk .sql.bz2
    • gunzip .sql.gz
    • extract FILE
  2. mysql -u root -p DB-NAME < /var/backups/automysqlbackup/INTERVAL/DB
Tags

apache2/
nginx/
letsencrypt/live/

Tags

.Spam/
.Trash/
.cache/yarn/
.cpan/
.cpanm/
.npm/
.oh-my-zsh/

# Mails
USERNAME/Maildir

# Dir 
*-enabled/
alternatives/
cache/
certs/
goaccess/
ipsets/
php/
rc0.d/
rc?.d/
systemd/

# drupal
vendor/
modules/
web/core/
web/themes/
shop/bin/
files/css/
files/js/
files/php/twig/
files/translations/
files/asset_injector/
fonts/
shariff/
core/

# File Type
*.gz
*.lock
*.reason
*.swp
.rnd

Tags

backup

  1. dpkg --get-selections > dpkg.txt

restore

  1. dpkg --clear-selections
  2. dpkg --set-selections < dpkg.txt
  3. apt-get autoremove
  4. apt-get dselect-upgrade