k0lter / autopostgresqlbackup

Automated tool to make periodic backups of PostgreSQL databases
52 stars 17 forks source link

Problem in v2: Only backups main database. Dangerous! #13

Closed hyperman2 closed 1 year ago

hyperman2 commented 1 year ago

The script has this code in dump(): db="${1}" ... cmd_args=("${DB}")

Note how the first is in lower case, and the second in upper case. As a result, the DB argument is never passed to pg_dump, so it reverts to the default database (probably 'postgres'). If you have a db cluster with 10 databases, you get 10 identical backups of the default database, named after the different database. The 9 other backups are missing.

k0lter commented 1 year ago

Thanks, for you feedback. I've just pushed a fix.

hyperman2 commented 1 year ago

This works perfectly. Thanks.