Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"dokku psql:dumpall" for backups #17

Open
henrik opened this issue Aug 26, 2015 · 3 comments
Open

"dokku psql:dumpall" for backups #17

henrik opened this issue Aug 26, 2015 · 3 comments

Comments

@henrik
Copy link

henrik commented Aug 26, 2015

Would be convenient to be able to crontab a single job to back up all databases, so you don't miss it when you add new ones.

There is a pg_dumpall – this seems to work:

docker exec psql-single-container su postgres -c "pg_dumpall" > /tmp/big.dump
@Flink
Copy link
Owner

Flink commented Aug 28, 2015

I don’t know if it’s the role of the plugin to deal with backups. To backup databases, I’m currently using this little script:

#!/bin/bash
BACKUP_DIR=/var/backups/dumps/psql
for raw_db_name in /home/dokku/.psql-sc/db*; do
  DB_NAME=$(echo $raw_db_name | sed 's/.*db_//')
  echo -n "Dumping $DB_NAME... "
  /usr/local/bin/dokku psql:dump $DB_NAME > "$BACKUP_DIR/${DB_NAME}.dump"
  echo "done"
done

@henrik
Copy link
Author

henrik commented Aug 29, 2015

Hm, yeah, good question. I would say it's outside the scope of the plugin to actually perform scheduled backups. But explicitly providing a backup story would be nice, to remind plugin users and to save them effort.

Your backup script does seem nicer than what I had. Maybe I could make a pull request just adding a README section with that as an example?

@Flink
Copy link
Owner

Flink commented Aug 31, 2015

Sure thing, it would be nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants