pgBackup: Backup PostgresSQL to the local filesystem with periodic rotating backups
Set your postgres host, username and password in the .env file along with a comma seperated list of databases you want to backup.
By default, backups run daily. Change PGBACKUP_SCHEDULE to any valid cron schedule to modify the default.
Recommended docker-compose overrides¶
For extra security, it is recommended to limit permissions on the backup folder to a priviledged user. Modify docker-compose.override.yml as below.
If you are using postgres docker container, add a dependency to the container
Manually trigger a backup¶
docker exec -it pgbackup ./backup.sh
Restore from latest backup¶
If the database already exists, drop it. Create a database