prodrigestivill / docker-postgres-backup-local

Backup PostgresSQL to local filesystem with periodic backups and rotate backups.
https://hub.docker.com/r/prodrigestivill/postgres-backup-local
MIT License
826 stars 140 forks source link

Restoring to new container #121

Closed riccardospeggiorin-centropaghe closed 1 year ago

riccardospeggiorin-centropaghe commented 1 year ago

I saw the command for restoring in a new container

docker run --rm --tty --interactive -v $BACKUPFILE:/tmp/backupfile.sql.gz postgres:$VERSION /bin/sh -c "zcat /tmp/backupfile.sql.gz | psql --host=$HOSTNAME --port=$PORT --username=$USERNAME --dbname=$DBNAME -W"

Am I getting this right? This create a new fresh container with the postresql dump that I specify? Why I need to specify the $HOSTNAME if is a new container? thanks

riccardospeggiorin-centropaghe commented 1 year ago

I figured it out.