Move _ansible directory into main directory

This commit is contained in:
Tobias Reisinger 2023-12-16 02:25:14 +01:00
parent 519882db43
commit 40742e3214
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
124 changed files with 246 additions and 141 deletions
roles/backup/files/node002

View file

@ -0,0 +1,14 @@
mkdir -p "$BACKUP_LOCATION/postgres"
cd "$BACKUP_LOCATION/postgres" || exit
postgres_tables=$(sudo -u postgres psql -Atc "SELECT datname FROM pg_database WHERE datistemplate = false;")
for i in $postgres_tables
do
printf "dumping %s ..." "$i"
sudo -u postgres pg_dump "$i" | gzip >"pg_dump_$i.gz"
echo " done"
done
echo "dumping all"
sudo -u postgres pg_dumpall | gzip >"pg_dumpall.gz"