How would you go about taking automatic rotated backups of a postgresql database running inside a docker 1.3 container? I'm mostly interested in the overall approach vs. the details of actual the backup commands themselves.
I am thinking about updating this autobackup script, which has apparently been around since 2005. My current plan is
- Install the script in cron.daily on the docker host
- Have the script use direct local filesystem access for the rotation logic to handle the existence tests,
mkdirandrmcommands - use
docker exec containernameto run thepsqlandpg_dumpcommands within the container, probably sending the stdout content to the docker host filesystem in the correct place via shell redirection