today I was trying to make some kind of backup for my postgres docker running on synology nas. Just documenting what I did so I can remember, don’t know if it’ll work though:

Principally you do backups like this:

pg_dumpall -U username > dumpfile.sql
and you restore via:
psql -U username -f dumpfile.sql postgres

now to automate this I found some reasonably looking scripts here. moved these on a mounted folder in the docker container and opened a terminal into the docker. Then tried out if running /bin/bash ./pg_backup_rotated.sh works and then automated it via an @daily in crontag -e

We’ll see how this’ll turn out.