Categories: Development

PostgreSQL Full Backup Bash Script

This simple Linux BASH script creates a PostgreSQL database Full-Dump to a file that can be used later by some cronjobs.

psql_garanet

GitHub https://github.com/garanet/PostgreSQL-bkp-script.git

  • Create a folder / backup with postgres user privileges and root group.
  • Place the following script named ‘full-db-psql.sh’ in the newly created folder.

#!/bin/sh
# www.garanet.net
# Identifico posizione di GZIP
GZIP="$(which gzip)"
  • Check that the script owner is root and change the permissions to 744.
  • As root, run the script with the command:: # sh full-db-psql.sh.

Share

Recent Posts

FastAPI, SQLAlchemy & Uvicorn

A FastAPI, SQLAlchemy & Uvicorn to fetch a Google Sheet A FastAPI, SQLAlchemy & Uvicorn to fetch a Google Sheet… Read More

Client TrueNas & Ldap with python Flask

A webtool in Python Flask that creates an LDAP user and his TrueNAS shares pool in ISCSI or NFS. There… Read More

Simple Terraform configuration

A Terraform configuration that provisions the following infrastructure: A VPC with: Public subnets for external resources. Private subnets for internal… Read More