Skip to content

Instantly share code, notes, and snippets.

View anderejd's full-sized avatar
💼
I don't have time for open source right now

anderejd

💼
I don't have time for open source right now
View GitHub Profile
@anderejd
anderejd / pg_restore_all_in_dir.sh
Created January 5, 2017 08:30
Restore all PostgreSQL database backups from a directory using psql and pg_restore.
#!/bin/bash
set -vx
root=`dirname "$(readlink -f "$0")"`
src="${root}/sqlbackup/data"
echo $src
sudo -u postgres psql --file=$src/globals.txt postgres
for fullfile in ${src}/*.dump; do