autopostgresqlbackup
- ai autopostgresqlbackup
- dpkg -L autopostgresqlbackup
- mkdir /var/backups/autopostgresqlbackup
- vim /etc/default/autopostgresqlbackup
- /usr/sbin/autopostgresqlbackup
- l /var/backups/autopostgresqlbackup/*/*
PeerTube
- https://docs.joinpeertube.org/maintain/migration
- 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
PostgreSQL Server
- ai postgresql
- systemctl status postgresql
- /etc/postgresql/15/main/pg_hba.conf
psql
- LANG=C
- psql -U postgres -c "SELECT datname FROM pg_catalog.pg_database;"
- psql -U postgres -c "DROP DATABASE DBNAME;"
- psql -U postgres -c "SELECT * FROM pg_catalog.pg_user;"
docker_pgsql_backup.sh
#!/bin/bash
# =============================================================================
# Script Name: docker_pgsql_backup.sh
# Version: 1.0
# Author: Andreas Fleckl
# Description: This script performs backups of PostgreSQL databases running in
# Docker containers.pgsql: purge all - re init
- systemctl stop postgresql
- rm -rf /var/lib/postgresql/15/main/
- sudo -u postgres /usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main/
- systemctl start postgresql