PGSQL Backup script for docker

Fetches all DBs running in the container. Define everything you need in the config section of the script.\ Allows you to define the date format. Allows you to define the days to keep backups. Allows you to define the user:group of the backups, in case you’re using a specific backup user. Sends you a discord notification once done. Setup and add a cron job, done. # bin/bash ################### ## Configuration ## ################### docker=postgres14 #container name of the PG databases admin=admin_user #admin user of PG bu_keep_days=7 #number of days to keep db_path=/PATH TO DB BACKUPS/ #path to save backups today=$(date +"%Y%m%d%H%M") #Date to name backups - YearMonthDayHourMinute user=user_id #for backup perms group=group_id #for backup perms disccolor=65280 #color of discord embed botname="PGSQL Backup" #Name that shows as bot name in Discord author_url=https://amoklauf....

June 23, 2023 · Gabe